Blame SOURCES/libvirt-qemuBlockBitmapsHandleCommitStart-Fix-allocation-of-string-list.patch

fbe740
From 83452775d46c10e2a33c2727f6c5e1d6e22ebdfe Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <83452775d46c10e2a33c2727f6c5e1d6e22ebdfe@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 17 Mar 2020 17:12:44 +0100
fbe740
Subject: [PATCH] qemuBlockBitmapsHandleCommitStart: Fix allocation of string
fbe740
 list
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Allocate space also for the terminating NULL.
fbe740
fbe740
Reported-by: Daniel P. Berrangé <berrange@redhat.com>
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
fbe740
Tested-by: Daniel P. Berrangé <berrange@redhat.com>
fbe740
(cherry picked from commit 061057e75461814e36aad1e78e96363d373ac34b)
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1799013
fbe740
Message-Id: <562a7faef6100c757b5556592093382b016755bb.1584461519.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_block.c | 2 +-
fbe740
 1 file changed, 1 insertion(+), 1 deletion(-)
fbe740
fbe740
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
fbe740
index 099ceeb802..dad3e2317f 100644
fbe740
--- a/src/qemu/qemu_block.c
fbe740
+++ b/src/qemu/qemu_block.c
fbe740
@@ -3019,7 +3019,7 @@ qemuBlockBitmapsHandleCommitStart(virStorageSourcePtr topsrc,
fbe740
     if (!(entry = virHashLookup(blockNamedNodeData, basesrc->nodeformat)))
fbe740
         return 0;
fbe740
 
fbe740
-    bitmaplist = g_new0(char *, entry->nbitmaps);
fbe740
+    bitmaplist = g_new0(char *, entry->nbitmaps + 1);
fbe740
 
fbe740
     for (i = 0; i < entry->nbitmaps; i++) {
fbe740
         qemuBlockNamedNodeDataBitmapPtr bitmap = entry->bitmaps[i];
fbe740
-- 
fbe740
2.25.1
fbe740