Torge Matthies : msvcp90: Fix segfault in bad_alloc exception default constructor.
Alexandre Julliard
julliard at winehq.org
Tue Jun 7 15:41:22 CDT 2022
Module: wine
Branch: master
Commit: 00012d3381c4fdd81d2e9c5fc7de5c74e7740cf9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=00012d3381c4fdd81d2e9c5fc7de5c74e7740cf9
Author: Torge Matthies <tmatthies at codeweavers.com>
Date: Tue Jun 7 10:30:07 2022 +0200
msvcp90: Fix segfault in bad_alloc exception default constructor.
Signed-off-by: Torge Matthies <tmatthies at codeweavers.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msvcp90/exception.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c
index 7f1dfd2188a..effe57063a1 100644
--- a/dlls/msvcp90/exception.c
+++ b/dlls/msvcp90/exception.c
@@ -36,7 +36,7 @@ int* __cdecl __processing_throw(void);
#if _MSVCP_VER >= 70 || defined(_MSVCIRT)
typedef const char **exception_name;
#define EXCEPTION_STR(name) (*name)
-#define EXCEPTION_NAME(str) ((exception_name)&str)
+#define EXCEPTION_NAME(str) (&str)
#else
typedef const char *exception_name;
#define EXCEPTION_STR(name) (name)
@@ -96,7 +96,7 @@ exception* __thiscall exception_copy_ctor(exception *this, const exception *rhs)
this->name = rhs->name;
this->do_free = FALSE;
} else
- MSVCP_exception_ctor(this, EXCEPTION_NAME(rhs->name));
+ MSVCP_exception_ctor(this, (exception_name)EXCEPTION_NAME(rhs->name));
TRACE("name = %s\n", this->name);
return this;
}
@@ -214,7 +214,7 @@ bad_alloc* __thiscall MSVCP_bad_alloc_ctor(bad_alloc *this, exception_name name)
DEFINE_THISCALL_WRAPPER(MSVCP_bad_alloc_default_ctor, 4)
bad_alloc* __thiscall MSVCP_bad_alloc_default_ctor(bad_alloc *this)
{
- static const char name[] = "bad allocation";
+ static const char *name = "bad allocation";
return MSVCP_bad_alloc_ctor(this, EXCEPTION_NAME(name));
}
More information about the wine-cvs
mailing list