From c45b02414a02ead949f04fccf9fb195a5f435e34 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Wed, 12 Feb 2020 10:59:49 +0000 Subject: [PATCH] Fix: Do not strcasecmp() content-type if unset (NULL) Thanks to lns for finding it. --- httpp/httpp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/httpp/httpp.c b/httpp/httpp.c index 6a3c0ef..ddecae4 100644 --- a/httpp/httpp.c +++ b/httpp/httpp.c @@ -280,6 +280,9 @@ int httpp_parse_postdata(http_parser_t *parser, const char *body_data, size_t le { const char *header = httpp_getvar(parser, "content-type"); + if (!header) + return -1; + if (strcasecmp(header, "application/x-www-form-urlencoded") != 0) { return -1; }