flock: NULL deref

cmd_argv[2] will be initialised only if it's specificed with -c.  NULL
deref otherwise resulting in crash.

Signed-off-by: Brad Forschinger <bnjf@bnjf.id.au>
This commit is contained in:
Brad Forschinger 2015-05-05 11:51:24 +10:00 committed by Karel Zak
parent 1eb1911893
commit b5575bc08c
1 changed files with 1 additions and 1 deletions

View File

@ -319,7 +319,7 @@ int main(int argc, char *argv[])
/* Clear any inherited settings */
signal(SIGCHLD, SIG_DFL);
if (verbose)
printf(_("%s: executing %s\n"), program_invocation_short_name, cmd_argv[2]);
printf(_("%s: executing %s\n"), program_invocation_short_name, cmd_argv[0]);
f = fork();
if (f < 0) {