mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 04:50:37 -04:00
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:
parent
bd1ed5f3c5
commit
953e2290fc
2
http.c
2
http.c
@ -2335,7 +2335,7 @@ evhttp_parse_query(const char *uri, struct evkeyvalq *headers)
|
|||||||
|
|
||||||
value = argument;
|
value = argument;
|
||||||
key = strsep(&value, "=");
|
key = strsep(&value, "=");
|
||||||
if (value == NULL)
|
if (value == NULL || *key == '\0')
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if ((decoded_value = mm_malloc(strlen(value) + 1)) == NULL) {
|
if ((decoded_value = mm_malloc(strlen(value) + 1)) == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user