From b65302b377cbf57eeb66c8f09e0806f7f5681b7b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 21 Mar 2018 12:42:44 -0400 Subject: [PATCH] qemu-thread-win32: Prevent null pointer dereference in win32_start_routine --- qemu/util/qemu-thread-win32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu/util/qemu-thread-win32.c b/qemu/util/qemu-thread-win32.c index 6b0b851e..bd066380 100644 --- a/qemu/util/qemu-thread-win32.c +++ b/qemu/util/qemu-thread-win32.c @@ -47,13 +47,14 @@ static unsigned __stdcall win32_start_routine(void *arg) QemuThreadData *data = (QemuThreadData *) arg; void *(*start_routine)(void *) = data->start_routine; void *thread_arg = data->arg; + struct uc_struct *uc = data->uc; if (data->mode == QEMU_THREAD_DETACHED) { data->uc->qemu_thread_data = NULL; g_free(data); data = NULL; } - qemu_thread_exit(data->uc, start_routine(thread_arg)); + qemu_thread_exit(uc, start_routine(thread_arg)); abort(); }