qcow2-bitmap: fix bitmap_free
PATCH 1/1 qcow2-bitmap: fix bitmap_free
Fix possible crash on error path in qcow2_remove_persistent_dirty_bitmap. Although bitmap_free was added in 88ddffae8fc the bug was introduced later in commit 469c71edc72 (when qcow2_remove_persistent_dirty_bitmap was added).
--- block/qcow2-bitmap.c | 4 ++++ 1 file changed, 4 insertions(+)
block/qcow2-bitmap.c +4 -0
@@ -487,6 +487,10 @@ static inline void bitmap_directory_to_be(uint8_t *dir, size_t size)static void bitmap_free (Qcow2Bitmap *bm) { +if (bm ==NULL ) { +return ; + } +g_free (bm->name);g_free (bm); }
Signature · 1 line
2.11.1
Max Reitz
AppliedQuoted 10 lines · Vladimir Sementsov-Ogievskiy
Fix possible crash on error path in
qcow2_remove_persistent_dirty_bitmap. Althoughbitmap_freewas added in88ddffae8fcthe bug was introduced later in commit469c71edc72(whenqcow2_remove_persistent_dirty_bitmapwas added).Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>Reviewed-by Eric Blake <[email protected]>--- block/qcow2-bitmap.c | 4 ++++ 1 file changed, 4 insertions(+)
Thanks, applied to my block branch:
https://github.com/XanClic/qemu/commits/block
Max
Maybe worth adding "Coverity: CID 1377700"
Quoted 18 lines · Max Reitz
Quoted 10 lines · Vladimir Sementsov-Ogievskiy
Fix possible crash on error path in
qcow2_remove_persistent_dirty_bitmap. Althoughbitmap_freewas added in88ddffae8fcthe bug was introduced later in commit469c71edc72(whenqcow2_remove_persistent_dirty_bitmapwas added).Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>Reviewed-by Eric Blake <[email protected]>--- block/qcow2-bitmap.c | 4 ++++ 1 file changed, 4 insertions(+)Thanks, applied to my block branch:
https://github.com/XanClic/qemu/commits/block
Max
Quoted 1 line · Philippe Mathieu-Daudé
Maybe worth adding "Coverity: CID 1377700"
At this point, the PULL request is already posted, so it may be too late. But it's not the end of the world if we miss the extra comment.
Quoted 21 lines · Max Reitz
Quoted 18 lines · Vladimir Sementsov-Ogievskiy
Quoted 10 lines
Fix possible crash on error path in
qcow2_remove_persistent_dirty_bitmap. Althoughbitmap_freewas added in88ddffae8fcthe bug was introduced later in commit469c71edc72(whenqcow2_remove_persistent_dirty_bitmapwas added).Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>Reviewed-by Eric Blake <[email protected]>--- block/qcow2-bitmap.c | 4 ++++ 1 file changed, 4 insertions(+)Thanks, applied to my block branch:
https://github.com/XanClic/qemu/commits/block
Max
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org