qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] migration/block-dirty-bitmap: fix Coverity CID1390625
@ 2018-10-16 13:20 Vladimir Sementsov-Ogievskiy
  2018-10-17  9:51 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
  2018-11-16 14:29 ` [Qemu-devel] " Stefan Hajnoczi
  0 siblings, 2 replies; 10+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2018-10-16 13:20 UTC (permalink / raw)
  To: qemu-devel, qemu-block
  Cc: dgilbert, quintela, famz, stefanha, peter.maydell, vsementsov,
	den

Theoretically possible that we finish the skipping loop with bs = NULL
and the following code will crash trying to dereference it. Fix that.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 migration/block-dirty-bitmap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 477826330c..6de808f95f 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -288,6 +288,10 @@ static int init_dirty_bitmap_migration(void)
             bs = backing_bs(bs);
         }
 
+        if (!bs || bs->implicit) {
+            continue;
+        }
+
         for (bitmap = bdrv_dirty_bitmap_next(bs, NULL); bitmap;
              bitmap = bdrv_dirty_bitmap_next(bs, bitmap))
         {
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-11-19 12:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-16 13:20 [Qemu-devel] [PATCH] migration/block-dirty-bitmap: fix Coverity CID1390625 Vladimir Sementsov-Ogievskiy
2018-10-17  9:51 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2018-11-15 11:48   ` Peter Maydell
2018-11-15 16:42     ` John Snow
2018-11-16  3:28     ` John Snow
2018-11-16 10:04       ` Peter Maydell
2018-11-16 16:16         ` John Snow
2018-11-16 16:49           ` Peter Maydell
2018-11-16 14:29 ` [Qemu-devel] " Stefan Hajnoczi
2018-11-19 11:55   ` Vladimir Sementsov-Ogievskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).