[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] block/nfs: Check for NULL server part
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH] block/nfs: Check for NULL server part |
Date: |
Mon, 5 May 2014 20:27:49 +0200 |
After the URL has been parsed make sure the server part is valid in
order to avoid a segmentation fault when calling nfs_mount().
Signed-off-by: Max Reitz <address@hidden>
---
block/nfs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/nfs.c b/block/nfs.c
index 9fa831f..539bd95 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");
--
1.9.2
- [Qemu-devel] [PATCH] block/nfs: Check for NULL server part,
Max Reitz <=