mirror of
https://github.com/moparisthebest/curl
synced 2024-12-25 01:28:51 -05:00
escape: zero length input should return a zero length output
Regression added in 7.71.0. Fixes #5601 Reported-by: Kristoffer Gleditsch Closes #5602
This commit is contained in:
parent
d2baa502fc
commit
32defc3197
@ -89,6 +89,9 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
|
|||||||
Curl_dyn_init(&d, CURL_MAX_INPUT_LENGTH);
|
Curl_dyn_init(&d, CURL_MAX_INPUT_LENGTH);
|
||||||
|
|
||||||
length = (inlength?(size_t)inlength:strlen(string));
|
length = (inlength?(size_t)inlength:strlen(string));
|
||||||
|
if(!length)
|
||||||
|
return strdup("");
|
||||||
|
|
||||||
while(length--) {
|
while(length--) {
|
||||||
unsigned char in = *string; /* we need to treat the characters unsigned */
|
unsigned char in = *string; /* we need to treat the characters unsigned */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user