summaryrefslogtreecommitdiffstats
path: root/tools/virtiofsd
diff options
context:
space:
mode:
authorDr. David Alan Gilbert2020-02-03 14:01:19 +0100
committerDr. David Alan Gilbert2020-02-10 18:24:43 +0100
commit99ce9a7e60fd12b213b985343ff8fcc172de59fd (patch)
tree2a257e05b5e394c1472787f8098edc79ada44773 /tools/virtiofsd
parentvirtiofsd: load_capng missing unlock (diff)
downloadqemu-99ce9a7e60fd12b213b985343ff8fcc172de59fd.tar.gz
qemu-99ce9a7e60fd12b213b985343ff8fcc172de59fd.tar.xz
qemu-99ce9a7e60fd12b213b985343ff8fcc172de59fd.zip
virtiofsd: do_read missing NULL check
Missing a NULL check if the argument fetch fails. Fixes: Coverity CID 1413119 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tools/virtiofsd')
-rw-r--r--tools/virtiofsd/fuse_lowlevel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
index 01c418aade..704c0369b2 100644
--- a/tools/virtiofsd/fuse_lowlevel.c
+++ b/tools/virtiofsd/fuse_lowlevel.c
@@ -1116,6 +1116,10 @@ static void do_read(fuse_req_t req, fuse_ino_t nodeid,
struct fuse_file_info fi;
arg = fuse_mbuf_iter_advance(iter, sizeof(*arg));
+ if (!arg) {
+ fuse_reply_err(req, EINVAL);
+ return;
+ }
memset(&fi, 0, sizeof(fi));
fi.fh = arg->fh;