From 6d5f1e4403217e143cc93d80ac96a40faf8bbae5 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 18 Oct 2009 10:39:10 +0000 Subject: Added a sanity check in kStrAt() svn-id: r45213 --- engines/sci/engine/kstring.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines') diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 2681ced5da..b31cd4018b 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -292,6 +292,11 @@ reg_t kStrCpy(EngineState *s, int argc, reg_t *argv) { reg_t kStrAt(EngineState *s, int argc, reg_t *argv) { + if (argv[0] == SIGNAL_REG) { + warning("Attempt to perform kStrAt() on a signal reg"); + return NULL_REG; + } + SegmentRef dest_r = s->_segMan->dereference(argv[0]); if (!dest_r.raw) { warning("Attempt to StrAt at invalid pointer %04x:%04x", PRINT_REG(argv[0])); -- cgit v1.2.3