]> 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>
Mon, 29 Feb 2016 21:41:39 +0000 (00:41 +0300)
* tests/test.c (check_ints): Fail (with the appropriate message) if
"list" argument is nil.

tests/test.c

index 6ae1b0588ad567a2754f2f3fd30088ea3e84d14d..8f37cd2b5e422c4f0c0a5ef1389e8d8ebe0d5098 100644 (file)
@@ -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");