From bd69fe8448024258d046e2a15d4cf5c498188144 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 11 Jun 2010 10:19:41 +0200 Subject: 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 Signed-off-by: Anthony Liguori --- qemu-option.c | 1 + 1 file changed, 1 insertion(+) (limited to 'qemu-option.c') diff --git a/qemu-option.c b/qemu-option.c index acd74f912..f88486580 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) { -- cgit v1.2.3