From: Daniel Stenberg Date: Tue, 6 Sep 2022 09:05:47 +0000 (+0200) Subject: tool_operate: fix msnprintfing the error message X-Git-Tag: curl-7_86_0~295 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b0dae2a433fccc6bd9d66f7e5a84fe5f0873030e;p=thirdparty%2Fcurl.git tool_operate: fix msnprintfing the error message Follow-up to 7be53774c41c59b47075fba Coverity CID 1513717 pointed out that we cannot use sizeof() on the error buffer anymore. Closes #9440 --- diff --git a/src/tool_operate.c b/src/tool_operate.c index 85544c414e..75ef68478a 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2325,8 +2325,9 @@ static CURLcode parallel_transfers(struct GlobalConfig *global, curl_multi_remove_handle(multi, easy); if(ended->abort && tres == CURLE_ABORTED_BY_CALLBACK) { - msnprintf(ended->errorbuffer, sizeof(ended->errorbuffer), - "Transfer aborted due to critical error in another transfer"); + msnprintf(ended->errorbuffer, CURL_ERROR_SIZE, + "Transfer aborted due to critical error " + "in another transfer"); } tres = post_per_transfer(global, ended, tres, &retry, &delay); progress_finalize(ended); /* before it goes away */