[PATCH 3/3] virtiofsd: check whether strdup lo.source return NULL in main func

2020-11-10 Thread Haotian Li
In main func, strdup lo.source may fail. So check whether strdup lo.source return NULL before using it. Signed-off-by: Haotian Li Signed-off-by: Zhiqiang Liu --- tools/virtiofsd/passthrough_ll.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools

[PATCH 2/3] virtiofsd: check whether lo_map_reserve returns NULL in, main func

2020-11-10 Thread Haotian Li
In main func, func lo_map_reserve is called without NULL check. If reallocing new_elems fails in func lo_map_grow, the func lo_map_reserve may return NULL. We should check whether lo_map_reserve returns NULL before using it. Signed-off-by: Haotian Li Signed-off-by: Zhiqiang Liu --- tools

[PATCH 1/3] tools/virtiofsd/buffer.c: check whether buf is NULL in fuse_bufvec_advance func

2020-11-10 Thread Haotian Li
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 Signed-off-by: Zhiqiang Liu --- tools/virtiofsd/buffer.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/virtiofsd

[PATCH v3 0/3] virtiofsd: fix some accessing NULL pointer problem

2020-11-10 Thread Haotian Li
Hi, We find some potential NULL pointer bugs on tools/virtiofsd. Three patches are made to fix them Haotian Li (3): tools/virtiofsd/buffer.c: check whether buf is NULL in fuse_bufvec_advance func virtiofsd: check whether lo_map_reserve returns NULL in main func virtiofsd: check

Re: [Virtio-fs] [PATCH v2 0/2] virtiofsd: fix some accessing NULL pointer problem

2020-11-10 Thread Haotian Li
Thanks for your suggestion. New patches will be resent. > On Tue, Nov 10, 2020 at 02:32:17PM +0800, Haotian Li wrote: >> Haotian Li (2): >> tools/virtiofsd/buffer.c: check whether buf is NULL in >> fuse_bufvec_advance func >> virtiofsd/passthrough_ll.c: c

[PATCH 2/2] virtiofsd: check whether lo_map_reserve returns NULL in main func

2020-11-09 Thread Haotian Li
In main func, func lo_map_reserve is called without NULL check. If reallocing new_elems fails in func lo_map_grow, the func lo_map_reserve may return NULL. We should check whether lo_map_reserve returns NULL before using it. Signed-off-by: Haotian Li Signed-off-by: Zhiqiang Liu --- tools

[PATCH 1/2] tools/virtiofsd/buffer.c: check whether buf is NULL in fuse_bufvec_advance func

2020-11-09 Thread Haotian Li
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 Signed-off-by: Zhiqiang Liu --- tools/virtiofsd/buffer.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/virtiofsd

[PATCH v2 0/2] virtiofsd: fix some accessing NULL pointer problem

2020-11-09 Thread Haotian Li
Haotian Li (2): tools/virtiofsd/buffer.c: check whether buf is NULL in fuse_bufvec_advance func virtiofsd/passthrough_ll.c: check whether lo_map_reserve returns NULL in main func tools/virtiofsd/buffer.c | 4 tools/virtiofsd/passthrough_ll.c | 10 +- 2 files

Re: [PATCH 0/2] virtiofsd: fix some accessing NULL pointer problem

2020-11-09 Thread Haotian Li
Hi, Thanks for your suggestion. We will fix the coding style problems and resend new patches. > Patchew URL: > https://patchew.org/QEMU/eeb2fd1d-a53d-eae6-4727-7f1a6b20a...@huawei.com/ > > > > Hi, > > This series seems to have some coding style problems. See output below for > more informatio

[PATCH 2/2] virtiofsd: check whether lo_map_reserve returns NULL in main func

2020-11-09 Thread Haotian Li
In main func, func lo_map_reserve is called without NULL check. If reallocing new_elems fails in func lo_map_grow, the func lo_map_reserve may return NULL. We should check whether lo_map_reserve returns NULL before using it. Signed-off-by: Haotian Li Signed-off-by: Zhiqiang Liu --- tools

[PATCH 1/2] tools/virtiofsd/buffer.c: check whether buf is NULL in fuse_bufvec_advance func

2020-11-09 Thread Haotian Li
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 Signed-off-by: Zhiqiang Liu --- tools/virtiofsd/buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/virtiofsd

[PATCH 0/2] virtiofsd: fix some accessing NULL pointer problem

2020-11-09 Thread Haotian Li
Hi, We find some potential NULL pointer bugs on tools/virtiofsd. Two patches are made to fix them. Haotian Li (2): tools/virtiofsd/buffer.c: check whether buf is NULL in fuse_bufvec_advance func virtiofsd/passthrough_ll.c: check whether lo_map_reserve returns NULL in main func