[Bug debuginfod/31637] segmentation fault when calling 'debuginfod-find -v'

fche at redhat dot com sourceware-bugzilla@sourceware.org
Fri Apr 12 21:41:35 GMT 2024


https://sourceware.org/bugzilla/show_bug.cgi?id=31637

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |fche at redhat dot com

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
Fixed with commit d9f38a7052c22c7762aa5b98b401e8a324336bce, committed as
obvious.

diff --git a/debuginfod/debuginfod-find.c b/debuginfod/debuginfod-find.c
index 307310988c4c..080dd8f2c6a3 100644
--- a/debuginfod/debuginfod-find.c
+++ b/debuginfod/debuginfod-find.c
@@ -136,7 +136,7 @@ main(int argc, char** argv)
   int remaining;
   (void) argp_parse (&argp, argc, argv, ARGP_IN_ORDER|ARGP_NO_ARGS,
&remaining, NULL);

-  if (argc < 2 || remaining+1 == argc) /* no arguments or at least two
non-option words */
+  if (argc < 2 || remaining+1 >= argc) /* no arguments or at least two
non-option words */


and a little test.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Elfutils-devel mailing list