[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 4/5] virtiofsd: do_read missing NULL check
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 4/5] virtiofsd: do_read missing NULL check |
Date: |
Mon, 10 Feb 2020 17:29:17 +0000 |
From: "Dr. David Alan Gilbert" <address@hidden>
Missing a NULL check if the argument fetch fails.
Fixes: Coverity CID 1413119
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
tools/virtiofsd/fuse_lowlevel.c | 4 ++++
1 file changed, 4 insertions(+)
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;
--
2.24.1
- [PULL 0/5] virtiofs queue, Dr. David Alan Gilbert (git), 2020/02/10
- [PULL 2/5] virtiofsd: fv_create_listen_socket error path socket leak, Dr. David Alan Gilbert (git), 2020/02/10
- [PULL 3/5] virtiofsd: load_capng missing unlock, Dr. David Alan Gilbert (git), 2020/02/10
- [PULL 4/5] virtiofsd: do_read missing NULL check,
Dr. David Alan Gilbert (git) <=
- [PULL 1/5] virtiofsd: Remove fuse_req_getgroups, Dr. David Alan Gilbert (git), 2020/02/10
- [PULL 5/5] docs: add virtiofsd(1) man page, Dr. David Alan Gilbert (git), 2020/02/10
- Re: [PULL 0/5] virtiofs queue, Peter Maydell, 2020/02/10