mirror of
https://github.com/moparisthebest/curl
synced 2024-11-12 04:25:08 -05: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
@ -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)
|
||||
|
@ -1150,7 +1150,6 @@ typedef enum {
|
||||
HTTPREQ_PUT,
|
||||
HTTPREQ_HEAD,
|
||||
HTTPREQ_OPTIONS,
|
||||
HTTPREQ_CUSTOM,
|
||||
HTTPREQ_LAST /* last in list */
|
||||
} Curl_HttpReq;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user