mirror of
https://github.com/curl/curl.git
synced 2026-07-24 17:07:16 +03:00
transfer: refuse POSTFIELDS + RESUME_FROM combo
The code assumes that such a resume is wanting to continue an upload using the read callback, and since POSTFIELDS is done without callback libcurl will just misbehave. This combo will make the transfer fail with CURLE_BAD_FUNCTION_ARGUMENT with an explanation in the error message. Reported-by: Smackd0wn on github Fixes #11081 Closes #11083
This commit is contained in:
parent
39434db41f
commit
fb7886b9c9
1 changed files with 6 additions and 0 deletions
|
|
@ -1325,6 +1325,12 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
|
|||
}
|
||||
}
|
||||
|
||||
if(data->set.postfields && data->set.set_resume_from) {
|
||||
/* we can't */
|
||||
failf(data, "cannot mix POSTFIELDS with RESUME_FROM");
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
}
|
||||
|
||||
data->state.prefer_ascii = data->set.prefer_ascii;
|
||||
data->state.list_only = data->set.list_only;
|
||||
data->state.httpreq = data->set.method;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue