bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gozilla: More robust input error handling


From: Shigio YAMAGUCHI
Subject: Re: [PATCH] gozilla: More robust input error handling
Date: Sat, 21 Oct 2017 22:00:02 +0900

Hi Punit,
I have committed your patch.
I feel happy to see GLOBAL in Debian.
Thank you!

Regards,
Shigio


2017-10-21 19:46 GMT+09:00 Punit Agrawal <address@hidden>:
From: Punit Agrawal <address@hidden>

The check for argc only tests if it is zero rather than any value less
than equal 0. This leads to segmentation fault when fed with invalid
input (Debian bug #715980).

Fix this by erroring out if argc <= 0.

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715980
---
Hi,

The debian bug report includes a reproducer. The patch below fixes the
issue for me and should be considered for upstream inclusion.

Thanks,
Punit

 gozilla/gozilla.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gozilla/gozilla.c b/gozilla/gozilla.c
index 22d2a95..050d228 100644
--- a/gozilla/gozilla.c
+++ b/gozilla/gozilla.c
@@ -273,7 +273,7 @@ main(int argc, char **argv)
         * Replace alias name.
         */
        if (definition == NULL) {
-               if (argc == 0)
+               if (argc <= 0)
                        usage();
                strbuf_puts(arg, argv[0]);
                /*
--
2.14.2


_______________________________________________
Bug-global mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-global



--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: 
26F6 31B4 3D62 4A92 7E6F  1C33 969C 3BE3 89DD A6EB

reply via email to

[Prev in Thread] Current Thread [Next in Thread]