* [Qemu-devel] [PATCH] block/nfs: Check for NULL server part
@ 2014-05-05 18:27 Max Reitz
2014-05-06 11:33 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Max Reitz @ 2014-05-05 18:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Peter Lieven, Stefan Hajnoczi, Max Reitz
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] block/nfs: Check for NULL server part
2014-05-05 18:27 [Qemu-devel] [PATCH] block/nfs: Check for NULL server part Max Reitz
@ 2014-05-06 11:33 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2014-05-06 11:33 UTC (permalink / raw)
To: Max Reitz; +Cc: Kevin Wolf, Peter Lieven, qemu-devel
On Mon, May 05, 2014 at 08:27:49PM +0200, Max Reitz wrote:
> 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>
> ---
> block/nfs.c | 4 ++++
> 1 file changed, 4 insertions(+)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-06 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-05 18:27 [Qemu-devel] [PATCH] block/nfs: Check for NULL server part Max Reitz
2014-05-06 11:33 ` Stefan Hajnoczi
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).