[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for 2.10 07/35] qcow2: fix null pointer derefere
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for 2.10 07/35] qcow2: fix null pointer dereference |
Date: |
Mon, 24 Jul 2017 13:46:58 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/24/2017 01:27 PM, Philippe Mathieu-Daudé wrote:
> If find_bitmap_by_name() fails we have bm=NULL and go to the 'fail' label,
> then
> call bitmap_free(bm) which does g_free(bm->name) with bm=NULL...
>
> Clang's scan-build-5.0 output:
> block/qcow2-bitmap.c:492:12: warning: Access to field 'name' results in a
> dereference of a null pointer (loaded from variable 'bm')
> g_free(bm->name);
> ^~~~~~~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> block/qcow2-bitmap.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Max already has a better patch from Vladimir pending on his block queue:
https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg04398.html
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH for 2.10 03/35] thunk: check nb_fields is valid before continuing, (continued)
- [Qemu-devel] [PATCH for 2.10 05/35] nbd: fix memory leak in nbd_opt_go(), Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 04/35] ivshmem: fix incorrect error handling in ivshmem_recv_msg(), Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 06/35] qcow2: remove inconsistent check, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 07/35] qcow2: fix null pointer dereference, Philippe Mathieu-Daudé, 2017/07/24
- Re: [Qemu-devel] [PATCH for 2.10 07/35] qcow2: fix null pointer dereference,
Eric Blake <=
- [Qemu-devel] [PATCH for 2.10 08/35] qcow2: fix null pointer dereference, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 09/35] ui/vnc: fix leak of SocketAddress **, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 10/35] net/eth: fix incorrect check of iov_to_buf() return value, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-devel] [PATCH for 2.10 11/35] i2c/exynos4210: correctly check i2c_recv() return value, Philippe Mathieu-Daudé, 2017/07/24