[*] Fix crash when calling ::what() on an external vendors exception

This commit is contained in:
Reece Wilson 2023-12-23 07:43:47 +00:00
parent 0faf4c7846
commit cdfb35d5a8

View File

@ -66,11 +66,16 @@ namespace Aurora::Debug
if (_strnicmp(descriptor->raw_name(), ".?AVException@", 15 - 1) == 0)
{
auto exception2 = reinterpret_cast<std::exception *>(exception);
auto wptr = exception2->what();
if (wptr)
if (IsReadable(exception) &&
IsReadable(*((AuUInt32 **)exception)) &&
(*(AuUInt32 **)exception)[2 - AuBuild::IsPlatformX32()])
{
suffix = wptr;
auto exception2 = reinterpret_cast<std::exception *>(exception);
auto wptr = exception2->what();
if (wptr)
{
suffix = wptr;
}
}
}
else if (_strnicmp(descriptor->raw_name(), ".PEAD", 5) == 0)