summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHervé Poussineau2017-07-15 15:28:41 +0200
committerKevin Wolf2017-07-18 15:14:36 +0200
commitf80256b7eebfbe20683b3a2b2720ad9991313761 (patch)
tree3e105ed2221d0f06b1baed6dd33eb584e6cd22bd
parentvvfat: correctly parse non-ASCII short and long file names (diff)
downloadqemu-f80256b7eebfbe20683b3a2b2720ad9991313761.tar.gz
qemu-f80256b7eebfbe20683b3a2b2720ad9991313761.tar.xz
qemu-f80256b7eebfbe20683b3a2b2720ad9991313761.zip
vvfat: initialize memory after allocating it
This prevents some host to guest memory content leaks. Fixes: https://bugs.launchpad.net/qemu/+bug/1599539 Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/vvfat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/vvfat.c b/block/vvfat.c
index ea7775f432..6b11596abf 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -115,6 +115,7 @@ static inline int array_ensure_allocated(array_t* array, int index)
array->pointer = g_realloc(array->pointer, new_size);
if (!array->pointer)
return -1;
+ memset(array->pointer + array->size, 0, new_size - array->size);
array->size = new_size;
array->next = index + 1;
}