]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: when aborting, make sure there is a non-NULL error buffer
authorDaniel Stenberg <daniel@haxx.se>
Mon, 7 Nov 2022 17:01:24 +0000 (18:01 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 7 Nov 2022 22:55:26 +0000 (23:55 +0100)
To store custom errors in. Or SIGSEGVs will follow.

Reported-by: Trail of Bits
Closes #9865

src/tool_operate.c

index 0accb554a841dced831431f6b9d8f08cbf202e00..c8509531c3cae67ac423c0eba9fa2545d7232a76 100644 (file)
@@ -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");