Fix crash when signal(qid,TIME) is not given a third argument
authorAri Johnson <ari@theari.com>
Mon, 18 Jul 2011 21:40:06 +0000 (17:40 -0400)
committerAri Johnson <ari@theari.com>
Mon, 18 Jul 2011 21:40:06 +0000 (17:40 -0400)
src/funmisc.c

index 2f254ce98f80329e0b4bd17a00014a3ec92f7d01..53db28d643a4e3b9ac927bb6638ebd63220ecf78 100644 (file)
@@ -725,7 +725,8 @@ FUNCTION(fun_signal) {
        if(qsig == QID_FALSE) {
                safe_str("#-1 INVALID SIGNAL", buff, bp);
                return;
-       } else if(qsig == QID_TIME && (!*args[2] || atoi(args[2]) < 0)) {
+       } else if(qsig == QID_TIME && (!args[2] || !*args[2] ||
+                                      atoi(args[2]) < 0)) {
                safe_str("#-1 INVALID TIME ARGUMENT", buff, bp);
                return;
        }