summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--block/nfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/nfs.c b/block/nfs.c
index 9fa831f160..539bd951df 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -256,6 +256,10 @@ static int64_t nfs_client_open(NFSClient *client, const char *filename,
         error_setg(errp, "Invalid URL specified");
         goto fail;
     }
+    if (!uri->server) {
+        error_setg(errp, "Invalid URL specified");
+        goto fail;
+    }
     strp = strrchr(uri->path, '/');
     if (strp == NULL) {
         error_setg(errp, "Invalid URL specified");