qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] block/curl.c: Check error return from curl_easy_setop


From: Hanna Reitz
Subject: Re: [PATCH v2 2/2] block/curl.c: Check error return from curl_easy_setopt()
Date: Thu, 24 Feb 2022 15:11:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 22.02.22 16:23, Peter Maydell wrote:
Coverity points out that we aren't checking the return value
from curl_easy_setopt() for any of the calls to it we make
in block/curl.c.

Some of these options are documented as always succeeding (e.g.
CURLOPT_VERBOSE) but others have documented failure cases (e.g.
CURLOPT_URL).  For consistency we check every call, even the ones
that theoretically cannot fail.

Fixes: Coverity CID 1459336, 1459482, 1460331
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Changes v1->v2:
  * set the error string in the failure path for the
    direct setopt calls in curl_open()
  * fix the failure path in curl_setup_preadv() by putting
    the curl_easy_setopt() call in the same if() condition
    as the existing curl_multi_add_handle()
---
  block/curl.c | 92 +++++++++++++++++++++++++++++++++-------------------
  1 file changed, 58 insertions(+), 34 deletions(-)

Reviewed-by: Hanna Reitz <hreitz@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]