Skip to content
Snippets Groups Projects
Commit 7fa87944 authored by Haotian Li's avatar Haotian Li Committed by Dr. David Alan Gilbert
Browse files

tools/virtiofsd/buffer.c: check whether buf is NULL in fuse_bufvec_advance func


In fuse_bufvec_advance func, calling fuse_bufvec_current func
may return NULL, so we should check whether buf is NULL before
using it.

Signed-off-by: default avatarHaotian Li <lihaotian9@huawei.com>
Signed-off-by: default avatarZhiqiang Liu <liuzhiqiang26@huawei.com>
Message-Id: <29fc87c2-b87c-4c34-40d4-75381f228849@huawei.com>
Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
parent f26688a9
No related branches found
No related tags found
No related merge requests found
......@@ -246,6 +246,10 @@ static int fuse_bufvec_advance(struct fuse_bufvec *bufv, size_t len)
{
const struct fuse_buf *buf = fuse_bufvec_current(bufv);
if (!buf) {
return 0;
}
bufv->off += len;
assert(bufv->off <= buf->size);
if (bufv->off == buf->size) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment