mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
escape: allow curl_easy_escape to generate 3*input length output
Instead of capping it to the 3 * CURL_MAX_INPUT_LENGTH. To allow users to URL encode larger chunks of data. Closes #14339
This commit is contained in:
parent
8a9c22796b
commit
9bfc7f9234
@ -63,12 +63,12 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
|
||||
if(!string || (inlength < 0))
|
||||
return NULL;
|
||||
|
||||
Curl_dyn_init(&d, CURL_MAX_INPUT_LENGTH * 3);
|
||||
|
||||
length = (inlength?(size_t)inlength:strlen(string));
|
||||
if(!length)
|
||||
return strdup("");
|
||||
|
||||
Curl_dyn_init(&d, length * 3 + 1);
|
||||
|
||||
while(length--) {
|
||||
/* treat the characters unsigned */
|
||||
unsigned char in = (unsigned char)*string++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user