提交 061057e7 编写于 作者: P Peter Krempa

qemuBlockBitmapsHandleCommitStart: Fix allocation of string list

Allocate space also for the terminating NULL.
Reported-by: NDaniel P. Berrangé <berrange@redhat.com>
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
Tested-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 b8a3ed95
......@@ -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];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册