]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
unix runmode: fix error handling. 231/head
authorEric Leblond <eric@regit.org>
Wed, 28 Nov 2012 17:02:09 +0000 (18:02 +0100)
committerEric Leblond <eric@regit.org>
Wed, 28 Nov 2012 17:02:09 +0000 (18:02 +0100)
If 'output-dir' argument was not given it was possible to reach a
possibly problematic condition.

src/runmode-unix-socket.c

index 7ab8717dd2afe67c142c225774d38e8806324ceb..83259c908a1e87026608abe134ff907a02884054 100644 (file)
@@ -215,6 +215,10 @@ TmEcode UnixSocketAddPcapFile(json_t *cmd, json_t* answer, void *data)
             return TM_ECODE_FAILED;
         }
         output_dir = json_string_value(oarg);
+    } else {
+        SCLogInfo("error: can't get output-dir");
+        json_object_set_new(answer, "message", json_string("output dir param is mandatory"));
+        return TM_ECODE_FAILED;
     }
 
 #ifdef OS_WIN32