aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/script_v60he.cpp
diff options
context:
space:
mode:
authorTravis Howell2010-10-23 02:18:08 +0000
committerTravis Howell2010-10-23 02:18:08 +0000
commitafd677c2c7a7e6dd088f64ff77bcb4fa154b4cc4 (patch)
tree16eb0b4553135c7b005163437cadf58d7384d74a /engines/scumm/he/script_v60he.cpp
parenta82b0435a2f6777fd91c85dc0058c9dbd2568306 (diff)
downloadscummvm-rg350-afd677c2c7a7e6dd088f64ff77bcb4fa154b4cc4.tar.gz
scummvm-rg350-afd677c2c7a7e6dd088f64ff77bcb4fa154b4cc4.tar.bz2
scummvm-rg350-afd677c2c7a7e6dd088f64ff77bcb4fa154b4cc4.zip
SCUMM: Fix buffer overflow, that was causing crashes when saving in Backyard Baseball 2001/2003.
svn-id: r53726
Diffstat (limited to 'engines/scumm/he/script_v60he.cpp')
-rw-r--r--engines/scumm/he/script_v60he.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index 8ade78c1b5..9d62a31f6d 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -283,15 +283,14 @@ void ScummEngine_v60he::o60_roomOps() {
break;
case 221:
byte buffer[100];
- int len, r;
+ int len;
convertMessageToString(_scriptPointer, buffer, sizeof(buffer));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
- r = convertFilePath(buffer, sizeof(buffer));
- memcpy(_saveLoadFileName, buffer + r, sizeof(buffer) - r);
- debug(1, "o60_roomOps: case 221: filename %s", _saveLoadFileName);
+ _saveLoadFileName = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
+ debug(1, "o60_roomOps: case 221: filename %s", _saveLoadFileName.c_str());
_saveLoadFlag = pop();
_saveLoadSlot = 255;