qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL
@ 2017-04-11 13:13 Max Reitz
  2017-04-11 13:23 ` Kevin Wolf
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Max Reitz @ 2017-04-11 13:13 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, Max Reitz, Jeff Cody, Peter Lieven, Kevin Wolf

Parsing the URI is not required to give us a scheme; uri->scheme may be
NULL.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/nfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/nfs.c b/block/nfs.c
index 0816678307..0c7d5619fe 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -83,7 +83,7 @@ static int nfs_parse_uri(const char *filename, QDict *options, Error **errp)
         error_setg(errp, "Invalid URI specified");
         goto out;
     }
-    if (strcmp(uri->scheme, "nfs") != 0) {
+    if (!uri->scheme || strcmp(uri->scheme, "nfs") != 0) {
         error_setg(errp, "URI scheme must be 'nfs'");
         goto out;
     }
-- 
2.12.2

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

end of thread, other threads:[~2017-04-11 13:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-11 13:13 [Qemu-devel] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL Max Reitz
2017-04-11 13:23 ` Kevin Wolf
2017-04-11 13:30 ` Peter Maydell
2017-04-11 13:53   ` Max Reitz
2017-04-11 13:58 ` Markus Armbruster
2017-04-11 13:59   ` Max Reitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).