aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2009-08-16 00:53:55 +0000
committerTravis Howell2009-08-16 00:53:55 +0000
commit58486725ec796fe0b2727e8aca4f99c3a139cae5 (patch)
treed43a7137a5c69975e905bf1ed8c15135780db75d
parentb6a0f3e3716614ee270df048414c7f938299c476 (diff)
downloadscummvm-rg350-58486725ec796fe0b2727e8aca4f99c3a139cae5.tar.gz
scummvm-rg350-58486725ec796fe0b2727e8aca4f99c3a139cae5.tar.bz2
scummvm-rg350-58486725ec796fe0b2727e8aca4f99c3a139cae5.zip
Fix overflow in convertFilePath().
svn-id: r43417
-rw-r--r--engines/scumm/he/script_v60he.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index f186495f81..7c109b1dcd 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -115,9 +115,10 @@ int ScummEngine_v60he::convertFilePath(byte *dst, int dstSize) {
int r = 0;
if (dst[len - 3] == 's' && dst[len - 2] == 'g') { // Save Game File
// Change filename prefix to target name, for save game files.
- char saveName[20];
+ char saveName[40];
+ memset(saveName, 0, sizeof(saveName));
sprintf(saveName, "%s.sg%c", _targetName.c_str(), dst[len - 1]);
- memcpy(dst, saveName, 20);
+ memcpy(dst, saveName, 40);
} else if (dst[0] == '.' && dst[1] == '/') { // Game Data Path
// The default game data path is set to './' by ScummVM
r = 2;