From f4fa8d226a95e42b252c07edb425c446370e01c0 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Wed, 25 Nov 2020 00:05:13 +0000 Subject: [PATCH] forbid a test iteration of 0 or less --- src/tests.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tests.c b/src/tests.c index bf96902edaa85..743acbd697e5c 100644 --- a/src/tests.c +++ b/src/tests.c @@ -5632,6 +5632,10 @@ int main(int argc, char **argv) { count = strtol(env, NULL, 0); } } + if (count <= 0) { + fputs("An iteration count of 0 or less is not allowed.\n", stderr); + return EXIT_FAILURE; + } printf("test count = %i\n", count); /* find random seed */