Output an error message instead of crashing with a segmentation
fault due to a NULL pointer dereference.
Bug found by Mayhem and reported by Alexandre Rebert.
Change-Id: I484f76411ed6899ea9af81256c1d392a84830d16
Reviewed-on: http://gerrit.openafs.org/10024
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
got_prefix = arg;
} else if (strcmp(arg, "v") == 0) {
arg = *++argv, argc--;
+ if (arg == NULL) {
+ fprintf(stderr, "%s: -v option requires an argument\n",
+ whoami);
+ usage();
+ exit(1);
+ }
version = atoi(arg);
if (version != 1 && version != 2) {
fprintf(stderr, "%s: unknown control argument -`%s'\n",