aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mortevielle')
-rw-r--r--engines/mortevielle/utils.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 2c1a501b19..28f3e4f629 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2487,6 +2487,8 @@ void MortevielleEngine::palette(int v1) {
*/
Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t size) {
+ assert(idx + size < s.size());
+
// Copy the substring into a temporary buffer
char *tmp = new char[size + 1];
strncpy(tmp, s.c_str() + idx - 1, size);