$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 \n", argv[0]); + exit (1); } reg = rrn_reg_new_full ();