From: Victor Julien Date: Fri, 31 Jan 2014 11:52:36 +0000 (+0100) Subject: Replace strchrnul with strchr X-Git-Tag: suricata-2.0rc1~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=717c271e58f09e560cd6274dba119f45ba014934;p=thirdparty%2Fsuricata.git Replace strchrnul with strchr And add a null check then of course. strchrnul isn't supported on all platforms. --- 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); }