diff options
| author | Max Reitz | 2014-05-05 20:27:49 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2014-05-09 13:32:16 +0200 |
| commit | 5f4d5e1aa652712ea39b6fd97114378c5c15ccda (patch) | |
| tree | 05bcf694e0871dc97148192315a9029911b528af | |
| parent | qemu-img: sort block formats in help message (diff) | |
| download | qemu-5f4d5e1aa652712ea39b6fd97114378c5c15ccda.tar.gz qemu-5f4d5e1aa652712ea39b6fd97114378c5c15ccda.tar.xz qemu-5f4d5e1aa652712ea39b6fd97114378c5c15ccda.zip | |
block/nfs: Check for NULL server part
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 <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| -rw-r--r-- | block/nfs.c | 4 |
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"); |
