From c6b1ec1220bf5b4d33b1011534bdef75fd6183be Mon Sep 17 00:00:00 2001 From: Zonr Chang Date: Wed, 24 Aug 2016 17:16:32 +0800 Subject: [PATCH] Fix evhttp_uriencode() regression. http_uriencode_test() (in test/regress_http.c) has been failed after 72afe4c as "hello\0world" is encoded to "hello" instead of "hello%00world". This is because of a misplaced overflow check which causes the non-negative "size" specified in parameter being ignored in within-bound URI. Fixes: #392 --- http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http.c b/http.c index 6fee8702..b9f909e4 100644 --- a/http.c +++ b/http.c @@ -3079,7 +3079,7 @@ evhttp_uriencode(const char *uri, ev_ssize_t len, int space_as_plus) } - if (len >= 0 && uri + len < uri) { + if (len >= 0) { if (uri + len < uri) { return (NULL); }