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:
parent
e03da26b71
commit
f80256b7ee
|
@ -115,6 +115,7 @@ static inline int array_ensure_allocated(array_t* array, int index)
|
||||||
array->pointer = g_realloc(array->pointer, new_size);
|
array->pointer = g_realloc(array->pointer, new_size);
|
||||||
if (!array->pointer)
|
if (!array->pointer)
|
||||||
return -1;
|
return -1;
|
||||||
|
memset(array->pointer + array->size, 0, new_size - array->size);
|
||||||
array->size = new_size;
|
array->size = new_size;
|
||||||
array->next = index + 1;
|
array->next = index + 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue