aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMax Horn2009-05-05 12:00:51 +0000
committerMax Horn2009-05-05 12:00:51 +0000
commit36f58b6378a5eea8565300096b9a9af9c26d66eb (patch)
tree86c3390364d5bc1ad7c2c5e1a90e31ffc25a026b /engines/sci
parent66067b0b6afc755497aa24be9fb9a2e5b2051303 (diff)
downloadscummvm-rg350-36f58b6378a5eea8565300096b9a9af9c26d66eb.tar.gz
scummvm-rg350-36f58b6378a5eea8565300096b9a9af9c26d66eb.tar.bz2
scummvm-rg350-36f58b6378a5eea8565300096b9a9af9c26d66eb.zip
SCI: Fixed out of bounds access in (still incomplete?) string frags code
svn-id: r40321
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/savegame.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 7741e802d2..83cd125f11 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -856,8 +856,8 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
str = &retval->sys_strings->strings[SYS_STRING_SAVEDIR];
internal_stringfrag_strncpy(s, str->value, s->sys_strings->strings[SYS_STRING_SAVEDIR].value, str->max_size);
- str->value[str->max_size].segment = s->string_frag_segment; // Make sure to terminate
- str->value[str->max_size].offset &= 0xff00; // Make sure to terminate
+ str->value[str->max_size - 1].segment = s->string_frag_segment; // Make sure to terminate
+ str->value[str->max_size - 1].offset &= 0xff00; // Make sure to terminate
// Time state:
retval->last_wait_time = g_system->getMillis();