]> granicus.if.org Git - gc/commitdiff
Fix unchecked pointer dereference in check_ints (gctest)
authorIvan Maidanski <ivmai@mail.ru>
Mon, 29 Feb 2016 21:41:39 +0000 (00:41 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 11 Mar 2016 21:07:03 +0000 (00:07 +0300)
* tests/test.c (check_ints): Fail (with the appropriate message) if
"list" argument is nil.

tests/test.c

index c1a7da39c17bd5717c6502638a2ff21894c37c7e..5b8bacd05d72020d722e4855ecff10ef9513254e 100644 (file)
@@ -412,6 +412,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");