From 717c271e58f09e560cd6274dba119f45ba014934 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 31 Jan 2014 12:52:36 +0100 Subject: [PATCH] Replace strchrnul with strchr And add a null check then of course. strchrnul isn't supported on all platforms. --- src/output-json-http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/output-json-http.c b/src/output-json-http.c index 0a968485e8..136bd8225e 100644 --- a/src/output-json-http.c +++ b/src/output-json-http.c @@ -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); } -- 2.47.3