Revision | 99ce9a7e60fd12b213b985343ff8fcc172de59fd (tree) |
---|---|
Zeit | 2020-02-11 02:24:43 |
Autor | Dr. David Alan Gilbert <dgilbert@redh...> |
Commiter | Dr. David Alan Gilbert |
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>
@@ -1116,6 +1116,10 @@ static void do_read(fuse_req_t req, fuse_ino_t nodeid, | ||
1116 | 1116 | struct fuse_file_info fi; |
1117 | 1117 | |
1118 | 1118 | arg = fuse_mbuf_iter_advance(iter, sizeof(*arg)); |
1119 | + if (!arg) { | |
1120 | + fuse_reply_err(req, EINVAL); | |
1121 | + return; | |
1122 | + } | |
1119 | 1123 | |
1120 | 1124 | memset(&fi, 0, sizeof(fi)); |
1121 | 1125 | fi.fh = arg->fh; |