Correct an off-by-one error in argv parsing.
Reported-By: <nolange79@gmail.com>
Signed-Off-By: Frank Ch. Eigler <fche@redhat.com>
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 */
{
argp_help (&argp, stderr, ARGP_HELP_USAGE, argv[0]);
return 1;
# Build-id for a file in the one of the testsuite's F31 rpms
RPM_BUILDID=d44d42cbd7d915bc938c81333a21e355a6022fb7
+# PR31637 argc range checking
+(testrun ${abs_top_builddir}/debuginfod/debuginfod-find -v 2>&1 || true) | grep Usage:
+
# Download sections from files indexed with -F
testrun ${abs_top_builddir}/debuginfod/debuginfod-find -vvv section $BUILDID .debug_info
testrun ${abs_top_builddir}/debuginfod/debuginfod-find -vvv section $BUILDID .text