summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debuginfod/debuginfod-find.c2
-rwxr-xr-xtests/run-debuginfod-section.sh3
2 files changed, 4 insertions, 1 deletions
diff --git a/debuginfod/debuginfod-find.c b/debuginfod/debuginfod-find.c
index 30731098..080dd8f2 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 */
{
argp_help (&argp, stderr, ARGP_HELP_USAGE, argv[0]);
return 1;
diff --git a/tests/run-debuginfod-section.sh b/tests/run-debuginfod-section.sh
index 66e53e83..6ac59688 100755
--- a/tests/run-debuginfod-section.sh
+++ b/tests/run-debuginfod-section.sh
@@ -81,6 +81,9 @@ wait_ready $PORT1 'thread_busy{role="scan"}' 0
# 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