mirror of
https://github.com/curl/curl.git
synced 2025-09-04 11:24:59 +03:00
tool_operate: use the correct config pointer
Triggered when doing 100+ parallel globbed upload transfers. Reported-by: letshack9707 on hackerone Closes #18200
This commit is contained in:
parent
4e5459c8e1
commit
4b61e44e3d
|
@ -260,16 +260,13 @@ static struct per_transfer *del_per_transfer(struct per_transfer *per)
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CURLcode pre_transfer(struct GlobalConfig *global,
|
static CURLcode pre_transfer(struct per_transfer *per)
|
||||||
struct per_transfer *per)
|
|
||||||
{
|
{
|
||||||
curl_off_t uploadfilesize = -1;
|
curl_off_t uploadfilesize = -1;
|
||||||
struct_stat fileinfo;
|
struct_stat fileinfo;
|
||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
#ifdef CURL_DISABLE_LIBCURL_OPTION
|
#ifndef CURL_DISABLE_LIBCURL_OPTION
|
||||||
(void)global; /* otherwise used in the my_setopt macros */
|
struct OperationConfig *config = per->config;
|
||||||
#else
|
|
||||||
struct OperationConfig *config = global->current;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(per->uploadfile && !stdin_upload(per->uploadfile)) {
|
if(per->uploadfile && !stdin_upload(per->uploadfile)) {
|
||||||
|
@ -1446,7 +1443,7 @@ static CURLcode add_parallel_transfers(struct GlobalConfig *global,
|
||||||
}
|
}
|
||||||
per->added = TRUE;
|
per->added = TRUE;
|
||||||
|
|
||||||
result = pre_transfer(global, per);
|
result = pre_transfer(per);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -1931,7 +1928,7 @@ static CURLcode serial_transfers(struct GlobalConfig *global,
|
||||||
|
|
||||||
start = curlx_now();
|
start = curlx_now();
|
||||||
if(!per->skip) {
|
if(!per->skip) {
|
||||||
result = pre_transfer(global, per);
|
result = pre_transfer(per);
|
||||||
if(result)
|
if(result)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user