]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Replace strchrnul with strchr
authorVictor Julien <victor@inliniac.net>
Fri, 31 Jan 2014 11:52:36 +0000 (12:52 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 31 Jan 2014 12:34:22 +0000 (13:34 +0100)
And add a null check then of course. strchrnul isn't supported on
all platforms.

src/output-json-http.c

index 0a968485e85098f924e342bda8861bfd23a03276..136bd8225e14a6244a8a44912645aa1f5d084fa4 100644 (file)
@@ -139,8 +139,9 @@ static void JsonHttpLogJSON(JsonHttpLogThread *aft, json_t *js, htp_tx_t *tx)
         char *p;
         c = bstr_util_strdup_to_c(h_content_type->value);
         if (c != NULL) {
-            p = strchrnul(c, ';');
-            *p = '\0';
+            p = strchr(c, ';');
+            if (p != NULL)
+                *p = '\0';
             json_object_set_new(hjs, "http_content_type", json_string(c));
             SCFree(c);
         }