From: Daniel Stenberg Date: Mon, 7 Nov 2022 17:01:24 +0000 (+0100) Subject: tool_operate: when aborting, make sure there is a non-NULL error buffer X-Git-Tag: curl-7_87_0~195 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0b24c93a99f5c3f97aa7c8377a7bcb7dbde8c1c;p=thirdparty%2Fcurl.git tool_operate: when aborting, make sure there is a non-NULL error buffer To store custom errors in. Or SIGSEGVs will follow. Reported-by: Trail of Bits Closes #9865 --- diff --git a/src/tool_operate.c b/src/tool_operate.c index 0accb554a8..c8509531c3 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2299,7 +2299,8 @@ static CURLcode parallel_transfers(struct GlobalConfig *global, curl_easy_getinfo(easy, CURLINFO_PRIVATE, (void *)&ended); curl_multi_remove_handle(multi, easy); - if(ended->abort && tres == CURLE_ABORTED_BY_CALLBACK) { + if(ended->abort && (tres == CURLE_ABORTED_BY_CALLBACK) && + ended->errorbuffer) { msnprintf(ended->errorbuffer, CURL_ERROR_SIZE, "Transfer aborted due to critical error " "in another transfer");