openbsd-ports/textproc/rarian/patches/patch-util_rarian-sk-migrate_cpp
ajacoutot 8e9be54b46 - add a patch from OpenSolaris to fix a hard crash in rarian-sk-migrate
- add /var/db/scrollkeeper/ removal to @extraunexec; it is not needed
anymore and people with earlier install can get rid of it
2009-02-15 13:41:41 +00:00

23 lines
699 B
Plaintext

$OpenBSD: patch-util_rarian-sk-migrate_cpp,v 1.1 2009/02/15 13:41:41 ajacoutot Exp $
Fix a Segmentation fault when argc is not fulfilled.
--- util/rarian-sk-migrate.cpp.orig Mon Sep 1 20:40:21 2008
+++ util/rarian-sk-migrate.cpp Sun Feb 15 14:31:15 2009
@@ -279,8 +279,14 @@ int main (int argc, char * argv[])
struct stat buf;
char *path = NULL;
- if (argc != 3 || access (argv[1], R_OK)) {
+ if (argc == 3) {
+ if (access (argv[1], R_OK) < 0)
fprintf (stderr, "ERROR: Cannot access directory %s\n", argv[1]);
+ exit (1);
+ }
+ else {
+ fprintf (stderr, "Usage: %s <Input Dir> <Program>\n", argv[0]);
+ exit (1);
}
reg = rrn_reg_new_full ();