From: Brad Forschinger Date: Tue, 5 May 2015 01:51:24 +0000 (+1000) Subject: flock: NULL deref X-Git-Tag: v2.27-rc1~214 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5575bc08cc778e522c793b0b909c6333a4bc503;p=thirdparty%2Futil-linux.git 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 --- diff --git a/sys-utils/flock.c b/sys-utils/flock.c index 84f1ec4864..fda7bdc488 100644 --- a/sys-utils/flock.c +++ b/sys-utils/flock.c @@ -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) {