From 3afbc4543f99fa5e81d5eae992bdf6146716f007 Mon Sep 17 00:00:00 2001 From: Alec Lofquist Date: Sat, 29 Nov 2014 14:42:30 -0600 Subject: [PATCH] Fixed buffer overflow in HttpReq::encodeUrl. I believe the character in the URL string was being read as a signed char instead of an unsigned char which caused weirdness with Unicode characters. --- es-core/src/HttpReq.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-core/src/HttpReq.cpp b/es-core/src/HttpReq.cpp index 5171da636..dfece200b 100644 --- a/es-core/src/HttpReq.cpp +++ b/es-core/src/HttpReq.cpp @@ -22,7 +22,7 @@ std::string HttpReq::urlEncode(const std::string &s) { escaped.append("%"); char buf[3]; - sprintf(buf, "%.2X", s[i]); + sprintf(buf, "%.2X", (unsigned char)s[i]); escaped.append(buf); } }