mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
Fixed bound checks for #74
This commit is contained in:
parent
890025e347
commit
d9479bc0b1
1 changed files with 2 additions and 2 deletions
|
@ -1001,9 +1001,9 @@ inline std::string decode_url(const std::string& s)
|
|||
{
|
||||
std::string result;
|
||||
|
||||
for (size_t i = 0; s[i]; i++) {
|
||||
for (size_t i = 0; i < s.size(); i++) {
|
||||
if (s[i] == '%' && i + 1 < s.size()) {
|
||||
if (s[i + 1] && s[i + 1] == 'u') {
|
||||
if (s[i + 1] == 'u') {
|
||||
int val = 0;
|
||||
if (from_hex_to_i(s, i + 2, 4, val)) {
|
||||
// 4 digits Unicode codes
|
||||
|
|
Loading…
Reference in a new issue