Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] NULL deref
@ 2015-05-05  1:51 Brad Forschinger
  2015-05-05 10:46 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Brad Forschinger @ 2015-05-05  1:51 UTC (permalink / raw)
  To: util-linux

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>

---
 sys-utils/flock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-utils/flock.c b/sys-utils/flock.c
index 84f1ec4..fda7bdc 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) {
--
2.3.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] NULL deref
  2015-05-05  1:51 [PATCH] NULL deref Brad Forschinger
@ 2015-05-05 10:46 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2015-05-05 10:46 UTC (permalink / raw)
  To: Brad Forschinger; +Cc: util-linux

On Tue, May 05, 2015 at 11:51:24AM +1000, Brad Forschinger wrote:
>  sys-utils/flock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

> -                       printf(_("%s: executing %s\n"),
> program_invocation_short_name, cmd_argv[2]);
> +                       printf(_("%s: executing %s\n"),
> program_invocation_short_name, cmd_argv[0]);

It seems your email client sucks :-) (due to extra line breaks...)
The best is to use git-send-email for the patches.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-05 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-05  1:51 [PATCH] NULL deref Brad Forschinger
2015-05-05 10:46 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox