Skip to content

Commit 4f7816d

Browse files
safeguard g_cxa_throw_handler
1 parent bd715da commit 4f7816d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/SentryCrash/Recording/Tools/SentryCrashCxaThrowSwapper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ __cxa_throw_decorator(void *thrown_exception, void *tinfo, void (*dest)(void *))
138138

139139
SENTRY_ASYNC_SAFE_LOG_TRACE("Decorating __cxa_throw");
140140

141+
if (g_cxa_throw_handler == NULL) {
142+
SENTRY_ASYNC_SAFE_LOG_WARN("g_cxa_throw_handler is NULL. Not doing anything");
143+
return;
144+
}
141145
g_cxa_throw_handler(thrown_exception, tinfo, dest);
142146

143147
void *backtraceArr[k_requiredFrames];

0 commit comments

Comments
 (0)