Piotr Caban : msvcrt: Fix _unDName crash when demangling class function pointer.
Alexandre Julliard
julliard at winehq.org
Fri Apr 30 16:03:29 CDT 2021
Module: wine
Branch: master
Commit: 7a1e7cbeee94756f3c474ba63b9fe9db8bddde3a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7a1e7cbeee94756f3c474ba63b9fe9db8bddde3a
Author: Piotr Caban <piotr at codeweavers.com>
Date: Fri Apr 30 20:50:59 2021 +0200
msvcrt: Fix _unDName crash when demangling class function pointer.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msvcrt/tests/cpp.c | 2 ++
dlls/msvcrt/undname.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c
index a63b3bc9bf5..80eab3364ba 100644
--- a/dlls/msvcrt/tests/cpp.c
+++ b/dlls/msvcrt/tests/cpp.c
@@ -1091,6 +1091,8 @@ static void test_demangle_datatype(void)
"class CDB_GEN_BIG_ENUM_FLAG<enum CDB_WYSIWYG_BITS_ENUM,32256>",TRUE},
{ "?AV?$CDB_GEN_BIG_ENUM_FLAG at W4CDB_WYSIWYG_BITS_ENUM@@$01@@@",
"?AV?$CDB_GEN_BIG_ENUM_FLAG at W4CDB_WYSIWYG_BITS_ENUM@@$01@@@", FALSE},
+ { "P8test@@AACXZ", "signed char (__cdecl test::*)(void)", TRUE},
+ { "P8test@@BACXZ", "signed char (__cdecl test::*)(void)const ", TRUE},
};
int i, num_test = ARRAY_SIZE(demangle);
diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c
index 51ce1d25665..a8e2ef2bd08 100644
--- a/dlls/msvcrt/undname.c
+++ b/dlls/msvcrt/undname.c
@@ -879,7 +879,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
goto done;
if (modifier)
modifier = str_printf(sym, "%s %s", modifier, ptr_modif);
- else if(ptr_modif[0])
+ else if(ptr_modif)
modifier = str_printf(sym, " %s", ptr_modif);
if (!get_calling_convention(*sym->current++,
&call_conv, &exported,
More information about the wine-cvs
mailing list