Skip to content

Commit

Permalink
vvfat: initialize memory after allocating it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hpoussin authored and kevmw committed Jul 18, 2017
1 parent e03da26 commit f80256b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/vvfat.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit f80256b

Please sign in to comment.