mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
qemuBlockBitmapsHandleCommitStart: Fix allocation of string list
Allocate space also for the terminating NULL. Reported-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
b8a3ed957e
commit
061057e754
@ -3021,7 +3021,7 @@ qemuBlockBitmapsHandleCommitStart(virStorageSourcePtr topsrc,
|
||||
if (!(entry = virHashLookup(blockNamedNodeData, basesrc->nodeformat)))
|
||||
return 0;
|
||||
|
||||
bitmaplist = g_new0(char *, entry->nbitmaps);
|
||||
bitmaplist = g_new0(char *, entry->nbitmaps + 1);
|
||||
|
||||
for (i = 0; i < entry->nbitmaps; i++) {
|
||||
qemuBlockNamedNodeDataBitmapPtr bitmap = entry->bitmaps[i];
|
||||
|
Loading…
Reference in New Issue
Block a user