]> git.proxmox.com Git - mirror_qemu.git/commit
block: Do not strcmp() with NULL uri->scheme
authorMax Reitz <mreitz@redhat.com>
Tue, 13 Jun 2017 20:57:26 +0000 (22:57 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 24 Aug 2017 21:58:11 +0000 (16:58 -0500)
commit438cd1e6aacbb0755ab8ec8a03d34998c3ab0ea3
tree08875e4bf9684eba5db89bb35bfb70047514faad
parent40ed5cdf724598f42907dd5a6b33f4f93dce398a
block: Do not strcmp() with NULL uri->scheme

uri_parse(...)->scheme may be NULL. In fact, probably every field may be
NULL, and the callers do test this for all of the other fields but not
for scheme (except for block/gluster.c; block/vxhs.c does not access
that field at all).

We can easily fix this by using g_strcmp0() instead of strcmp().

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20170613205726.13544-1-mreitz@redhat.com
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit f69165a8feca055cf4a37d13ab0fc5beec3cb372)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/nbd.c
block/nfs.c
block/sheepdog.c
block/ssh.c