mirror of
https://github.com/curl/curl.git
synced 2026-08-09 08:04:16 +03:00
pretransfer: don't strlen() POSTFIELDS set for GET requests
... since that data won't be used in the request anyway. Fixes #3548 Reported-by: Renaud Allard Close #3549
This commit is contained in:
parent
aabc7ae5ec
commit
a6d134e17a
2 changed files with 4 additions and 2 deletions
|
|
@ -1526,11 +1526,14 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
|
|||
|
||||
if(data->set.httpreq == HTTPREQ_PUT)
|
||||
data->state.infilesize = data->set.filesize;
|
||||
else {
|
||||
else if((data->set.httpreq != HTTPREQ_GET) &&
|
||||
(data->set.httpreq != HTTPREQ_HEAD)) {
|
||||
data->state.infilesize = data->set.postfieldsize;
|
||||
if(data->set.postfields && (data->state.infilesize == -1))
|
||||
data->state.infilesize = (curl_off_t)strlen(data->set.postfields);
|
||||
}
|
||||
else
|
||||
data->state.infilesize = 0;
|
||||
|
||||
/* If there is a list of cookie files to read, do it now! */
|
||||
if(data->change.cookielist)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue