From 4bd31dae9b638bb6c80ddc3db7b41f34c68626fc Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Mon, 25 Sep 2017 21:14:28 -0500 Subject: SCI: Fix use-after-free when kernel call debugging is active during a save game restore --- engines/sci/engine/scriptdebug.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index cfe0ebeb64..d46b630292 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -988,6 +988,10 @@ void debugPropertyAccess(Object *obj, reg_t objp, unsigned int index, reg_t curV } void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *kernelSubCall, EngineState *s, int argc, reg_t *argv, reg_t result) { + if (s->abortScriptProcessing != kAbortNone) { + return; + } + Kernel *kernel = g_sci->getKernel(); if (!kernelSubCall) { debugN("k%s: ", kernelCall->name); -- cgit v1.2.3