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.
This commit is contained in:
Alec Lofquist 2014-11-29 14:42:30 -06:00
parent 0dcfc2945d
commit 3afbc4543f

View file

@ -22,7 +22,7 @@ std::string HttpReq::urlEncode(const std::string &s)
{ {
escaped.append("%"); escaped.append("%");
char buf[3]; char buf[3];
sprintf(buf, "%.2X", s[i]); sprintf(buf, "%.2X", (unsigned char)s[i]);
escaped.append(buf); escaped.append(buf);
} }
} }