From: Rusty Russell Date: Tue, 5 Feb 2019 04:04:47 +0000 (+1030) Subject: configurator: fix crash when more than one extra test provided X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=e16fc94bd8f80800d5203d9182cb3c5224528b0a;ds=sidebyside configurator: fix crash when more than one extra test provided Signed-off-by: Rusty Russell --- 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; } }