[virt-tools-list] [vhostmd virtio PATCH v3 1/6] Initialize allocated buffer
Michael Trapp
Michael.Trapp at sap.com
Mon Nov 12 15:12:16 UTC 2018
buffer_grow uses realloc to extend the buffer, due to the fact that
realloc doesn't guarantee that allocated memory is initialized there
should be a memset.
---
vhostmd/util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/vhostmd/util.c b/vhostmd/util.c
index 70fc804..804c483 100644
--- a/vhostmd/util.c
+++ b/vhostmd/util.c
@@ -53,6 +53,7 @@ static int buffer_grow(vu_buffer *buf, int len)
return -1;
buf->size = size;
+ memset(&buf->content[buf->use], 0, len);
return 0;
}
--
2.17.1 (Apple Git-112)
More information about the virt-tools-list
mailing list