From a15703001088d77c45dc038168ff382d457de985 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 1 Mar 2016 00:41:39 +0300 Subject: [PATCH] Fix unchecked pointer dereference in check_ints (gctest) * tests/test.c (check_ints): Fail (with the appropriate message) if "list" argument is nil. --- tests/test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test.c b/tests/test.c index 6ae1b058..8f37cd2b 100644 --- a/tests/test.c +++ b/tests/test.c @@ -413,6 +413,10 @@ sexpr uncollectable_ints(int low, int up) void check_ints(sexpr list, int low, int up) { + if (is_nil(list)) { + GC_printf("list is nil\n"); + FAIL; + } if (SEXPR_TO_INT(car(car(list))) != low) { GC_printf( "List reversal produced incorrect list - collector is broken\n"); -- 2.40.0