From: Daniel Stenberg Date: Mon, 9 May 2022 10:56:21 +0000 (+0200) Subject: post_per_transfer: remove the updated file name X-Git-Tag: curl-7_83_1~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c7ee9083d0d719d0a77ab20d9cc2ae84eeea7f3;p=thirdparty%2Fcurl.git post_per_transfer: remove the updated file name When --remove-on-error is used with --no-clobber, it might have an updated file name to remove. Bug: https://curl.se/docs/CVE-2022-27778.html CVE-2022-27778 Reported-by: Harry Sintonen Closes #8824 --- diff --git a/src/tool_operate.c b/src/tool_operate.c index cb587e0a64..daaf0bcd49 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -596,8 +596,8 @@ static CURLcode post_per_transfer(struct GlobalConfig *global, fprintf(global->errors, "curl: (%d) Failed writing body\n", result); } if(result && config->rm_partial) { - notef(global, "Removing output file: %s", per->outfile); - unlink(per->outfile); + notef(global, "Removing output file: %s\n", outs->filename); + unlink(outs->filename); } }