mirror of
https://github.com/curl/curl.git
synced 2026-08-25 16:23:36 +03: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
1 changed files with 2 additions and 2 deletions
|
|
@ -63,12 +63,12 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
|
||||||
if(!string || (inlength < 0))
|
if(!string || (inlength < 0))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Curl_dyn_init(&d, CURL_MAX_INPUT_LENGTH * 3);
|
|
||||||
|
|
||||||
length = (inlength?(size_t)inlength:strlen(string));
|
length = (inlength?(size_t)inlength:strlen(string));
|
||||||
if(!length)
|
if(!length)
|
||||||
return strdup("");
|
return strdup("");
|
||||||
|
|
||||||
|
Curl_dyn_init(&d, length * 3 + 1);
|
||||||
|
|
||||||
while(length--) {
|
while(length--) {
|
||||||
/* treat the characters unsigned */
|
/* treat the characters unsigned */
|
||||||
unsigned char in = (unsigned char)*string++;
|
unsigned char in = (unsigned char)*string++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue