From c0b24c93a99f5c3f97aa7c8377a7bcb7dbde8c1c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 7 Nov 2022 18:01:24 +0100 Subject: [PATCH] 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 --- src/tool_operate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"); -- 2.47.3