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
This commit is contained in:
Daniel Stenberg 2022-11-07 18:01:24 +01:00
parent 1188c6b8ea
commit c0b24c93a9
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View 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");