All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] block/curl: check error return from curl_easy_setopt()
@ 2022-02-22 15:23 Peter Maydell
  2022-02-22 15:23 ` [PATCH v2 1/2] block/curl.c: Set error message string if curl_init_state() fails Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Peter Maydell @ 2022-02-22 15:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Hanna Reitz, qemu-block

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.

Tested with 'make check' and with some basic smoke test command lines
suggested by Dan:

 qemu-img info https://cloud.debian.org/images/cloud/buster/daily/latest/debian-10-nocloud-amd64-daily.qcow2
 qemu-img info --image-opts driver=qcow2,file.driver=https,file.url=https://cloud.debian.org/images/cloud/buster/daily/latest/debian-10-nocloud-amd64-daily.qcow2

Changes v1->v2:
 * new patch 1 which fixes a missing "set the error string" for
   when curl_init_state() returns failure, since we're about to
   add more cases when that function can fail
 * 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()

thanks
-- PMM

Peter Maydell (2):
  block/curl.c: Set error message string if curl_init_state() fails
  block/curl.c: Check error return from curl_easy_setopt()

 block/curl.c | 94 +++++++++++++++++++++++++++++++++-------------------
 1 file changed, 60 insertions(+), 34 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-02-24 14:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 15:23 [PATCH v2 0/2] block/curl: check error return from curl_easy_setopt() Peter Maydell
2022-02-22 15:23 ` [PATCH v2 1/2] block/curl.c: Set error message string if curl_init_state() fails Peter Maydell
2022-02-22 21:30   ` Philippe Mathieu-Daudé
2022-02-24 14:08   ` Hanna Reitz
2022-02-22 15:23 ` [PATCH v2 2/2] block/curl.c: Check error return from curl_easy_setopt() Peter Maydell
2022-02-24 14:11   ` Hanna Reitz
2022-02-24 14:26     ` Peter Maydell
2022-02-24 14:13 ` [PATCH v2 0/2] block/curl: check " Hanna Reitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.