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>
This commit is contained in:
Hervé Poussineau 2017-07-15 15:28:41 +02:00 committed by Kevin Wolf
parent e03da26b71
commit f80256b7ee
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}