[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    [PATCH 1/2] vcruntime140_1: Check for NULL type in dump_exception_type().
From:       Paul Gofman <pgofman () codeweavers ! com>
Date:       2020-08-31 13:23:11
Message-ID: 20200831132312.772002-1-pgofman () codeweavers ! com
[Download RAW message or body]

Fixes crash with +seh debug channel in
https://github.com/microsoft/compiler-tests/blob/master/eh/ehthrow.cxx.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
---
 dlls/vcruntime140_1/except_x86_64.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/dlls/vcruntime140_1/except_x86_64.c b/dlls/vcruntime140_1/except_x86_64.c
index 0e27b02db13..367d5563f1d 100644
--- a/dlls/vcruntime140_1/except_x86_64.c
+++ b/dlls/vcruntime140_1/except_x86_64.c
@@ -247,9 +247,17 @@ static inline void dump_type(UINT type_rva, ULONG64 base)
 
 static void dump_exception_type(const cxx_exception_type *type, ULONG64 base)
 {
-    const cxx_type_info_table *type_info_table = rva_to_ptr(type->type_info_table, base);
+    const cxx_type_info_table *type_info_table;
     UINT i;
 
+    if (!type)
+    {
+        TRACE("NULL type\n");
+        return;
+    }
+
+    type_info_table = rva_to_ptr(type->type_info_table, base);
+
     TRACE("flags %x destr %x(%p) handler %x(%p) type info %x(%p)\n",
             type->flags, type->destructor, rva_to_ptr(type->destructor, base),
             type->custom_handler, rva_to_ptr(type->custom_handler, base),
-- 
2.26.2


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic