[Scummvm-cvs-logs] SF.net SVN: scummvm:[43417] scummvm/trunk/engines/scumm/he/script_v60he.cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sun Aug 16 02:53:55 CEST 2009


Revision: 43417
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43417&view=rev
Author:   Kirben
Date:     2009-08-16 00:53:55 +0000 (Sun, 16 Aug 2009)

Log Message:
-----------
Fix overflow in convertFilePath().

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/script_v60he.cpp

Modified: scummvm/trunk/engines/scumm/he/script_v60he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v60he.cpp	2009-08-16 00:20:23 UTC (rev 43416)
+++ scummvm/trunk/engines/scumm/he/script_v60he.cpp	2009-08-16 00:53:55 UTC (rev 43417)
@@ -115,9 +115,10 @@
 	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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list