From 2b2af124661c0d383279ef910c61ab70336414fe Mon Sep 17 00:00:00 2001 From: Michael Ehrenreich Date: Fri, 26 Jun 2015 01:33:41 +0200 Subject: [PATCH] Prevent nullptr dereference on a crash with no JIT present JitInterface::HandleFault would dereference jit which is NULL, causing a stack overflow through infinite exception recursion. --- Source/Core/Core/PowerPC/JitInterface.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Core/PowerPC/JitInterface.cpp b/Source/Core/Core/PowerPC/JitInterface.cpp index 13a1df05ea..0a8b89213a 100644 --- a/Source/Core/Core/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/PowerPC/JitInterface.cpp @@ -203,6 +203,12 @@ namespace JitInterface bool HandleFault(uintptr_t access_address, SContext* ctx) { + // Prevent nullptr dereference on a crash with no JIT present + if (!jit) + { + return false; + } + return jit->HandleFault(access_address, ctx); }