From e16fc94bd8f80800d5203d9182cb3c5224528b0a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 5 Feb 2019 14:34:47 +1030 Subject: [PATCH] configurator: fix crash when more than one extra test provided Signed-off-by: Rusty Russell --- tools/configurator/configurator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c index 1386fc90..f15f3448 100644 --- a/tools/configurator/configurator.c +++ b/tools/configurator/configurator.c @@ -888,7 +888,8 @@ static void read_tests(size_t num_tests) { while (read_test(tests + num_tests)) { num_tests++; - tests = realloc(tests, num_tests * sizeof(tests[0])); + tests = realloc(tests, (num_tests + 1) * sizeof(tests[0])); + tests[num_tests].name = NULL; } } -- 2.39.2