mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Don't assume argv[0] is set without first checking argc.
This commit is contained in:
@@ -379,8 +379,10 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv,
|
||||
}
|
||||
env_add[nenv] = NULL;
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
if (argc > 0) {
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
}
|
||||
|
||||
if (!mode) {
|
||||
/* Defer -k mode setting until we know whether it is a flag or not */
|
||||
|
Reference in New Issue
Block a user