mirror of https://github.com/moparisthebest/curl
curl_unescape() did not stop at the set length properly when %-codes were
used
This commit is contained in:
parent
2c123051bb
commit
b734bc37eb
|
@ -100,7 +100,7 @@ char *curl_unescape(char *string, int length)
|
||||||
the "query part" where '+' should become ' '.
|
the "query part" where '+' should become ' '.
|
||||||
RFC 2316, section 3.10 */
|
RFC 2316, section 3.10 */
|
||||||
|
|
||||||
while(--alloc) {
|
while(--alloc > 0) {
|
||||||
in = *string;
|
in = *string;
|
||||||
if(querypart && ('+' == in))
|
if(querypart && ('+' == in))
|
||||||
in = ' ';
|
in = ' ';
|
||||||
|
@ -113,6 +113,7 @@ char *curl_unescape(char *string, int length)
|
||||||
if(sscanf(string+1, "%02X", &hex)) {
|
if(sscanf(string+1, "%02X", &hex)) {
|
||||||
in = hex;
|
in = hex;
|
||||||
string+=2;
|
string+=2;
|
||||||
|
alloc-=2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue