mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 11:53:00 -04:00
uri decode: fix for warning "use of uninitialised value"
This patch add check in evhttp_decode_uri_internal() that next 2 symbols are exists in array of chars for decoding, if don't have two next 2 symbols don't try to decode '%FF'
This commit is contained in:
parent
87c56727b6
commit
64b6eceaba
4
http.c
4
http.c
@ -2889,8 +2889,8 @@ evhttp_decode_uri_internal(
|
||||
decode_plus = 1;
|
||||
} else if (c == '+' && decode_plus) {
|
||||
c = ' ';
|
||||
} else if (c == '%' && EVUTIL_ISXDIGIT_(uri[i+1]) &&
|
||||
EVUTIL_ISXDIGIT_(uri[i+2])) {
|
||||
} else if (length > 2 && i < (length - 2) && c == '%' &&
|
||||
EVUTIL_ISXDIGIT_(uri[i+1]) && EVUTIL_ISXDIGIT_(uri[i+2])) {
|
||||
char tmp[3];
|
||||
tmp[0] = uri[i+1];
|
||||
tmp[1] = uri[i+2];
|
||||
|
Loading…
x
Reference in New Issue
Block a user