Refuse null keys in evhttp_parse_query()

evhttp_parse_query() currently accepts empty keys, that don't make any
sense.

-Frank

[From sourceforge patch 2995183]
-Nick
This commit is contained in:
Frank Denis 2010-05-03 11:29:22 -04:00 committed by Nick Mathewson
parent bd1ed5f3c5
commit 953e2290fc

2
http.c
View File

@ -2335,7 +2335,7 @@ evhttp_parse_query(const char *uri, struct evkeyvalq *headers)
value = argument;
key = strsep(&value, "=");
if (value == NULL)
if (value == NULL || *key == '\0')
goto error;
if ((decoded_value = mm_malloc(strlen(value) + 1)) == NULL) {