Replace strchrnul with strchr

And add a null check then of course. strchrnul isn't supported on
all platforms.
pull/809/merge
Victor Julien 12 years ago
parent 1e4421a7d4
commit 717c271e58

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

Loading…
Cancel
Save