[PATCH 1/2] vcruntime140_1: Check for NULL type in dump_exception_type().

Paul Gofman pgofman at codeweavers.com
Mon Aug 31 08:23:11 CDT 2020


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

Signed-off-by: Paul Gofman <pgofman at 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




More information about the wine-devel mailing list