diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-06-11 10:19:41 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-06-14 11:12:53 -0500 |
commit | bd69fe8448024258d046e2a15d4cf5c498188144 (patch) | |
tree | e1357f8f5bade1e051e6c9bfceb2ed0f48ebaa85 /qemu-option.c | |
parent | 271248886e6110b4af0545f6a2d3ef38217cd58f (diff) | |
download | qemu-bd69fe8448024258d046e2a15d4cf5c498188144.zip qemu-bd69fe8448024258d046e2a15d4cf5c498188144.tar.gz qemu-bd69fe8448024258d046e2a15d4cf5c498188144.tar.bz2 |
qemu-option: Fix uninitialized value in append_option_parameter
When dest is NULL, i.e. a new copy of the list is created, we don't get a
properly terminated list after the realloc. Initialize it as an empty list.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-option.c')
-rw-r--r-- | qemu-option.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/qemu-option.c b/qemu-option.c index acd74f9..f884865 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -378,6 +378,7 @@ QEMUOptionParameter *append_option_parameters(QEMUOptionParameter *dest, num_options += count_option_parameters(list); dest = qemu_realloc(dest, (num_options + 1) * sizeof(QEMUOptionParameter)); + dest[num_dest_options].name = NULL; while (list && list->name) { if (get_option_parameter(dest, list->name) == NULL) { |