From 58486725ec796fe0b2727e8aca4f99c3a139cae5 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 16 Aug 2009 00:53:55 +0000 Subject: Fix overflow in convertFilePath(). svn-id: r43417 --- engines/scumm/he/script_v60he.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/scumm') 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; -- cgit v1.2.3