The new Scheme-like interpreter can end up with a NULL pointer dereference
if the for-loop exits immediately.

--- a/src/interpreter.c
+++ b/src/interpreter.c
@@ -335,7 +335,10 @@ foundlist(char *defstr)
                        spc = 0;
                }
        }
-       *vendp = '\0';
+
+       if (vendp)
+               *vendp = '\0';
+
        if ((v1->vals = strndup(valp, BUFSIZE)) == NULL)
                return(dobeep_msg("strndup error"));

Reply via email to