* Haotian Li ([email protected]) wrote: > 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: Haotian Li <[email protected]> > Signed-off-by: Zhiqiang Liu <[email protected]> > --- > tools/virtiofsd/buffer.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/virtiofsd/buffer.c b/tools/virtiofsd/buffer.c > index 27c1377f22..bdc608c221 100644 > --- a/tools/virtiofsd/buffer.c > +++ b/tools/virtiofsd/buffer.c > @@ -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; > + } > +
Reviewed-by: Dr. David Alan Gilbert <[email protected]> > bufv->off += len; > assert(bufv->off <= buf->size); > if (bufv->off == buf->size) { > -- > > _______________________________________________ > Virtio-fs mailing list > [email protected] > https://www.redhat.com/mailman/listinfo/virtio-fs -- Dr. David Alan Gilbert / [email protected] / Manchester, UK
