[Scummvm-cvs-logs] SF.net SVN: scummvm: [27135] scummvm/branches/branch-0-10-0/engines/agi/ agi_v3.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Jun 6 15:30:48 CEST 2007


Revision: 27135
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27135&view=rev
Author:   sev
Date:     2007-06-06 06:30:47 -0700 (Wed, 06 Jun 2007)

Log Message:
-----------
Backport another potential memory overwrite fix.

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/engines/agi/agi_v3.cpp

Modified: scummvm/branches/branch-0-10-0/engines/agi/agi_v3.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agi/agi_v3.cpp	2007-06-06 13:29:27 UTC (rev 27134)
+++ scummvm/branches/branch-0-10-0/engines/agi/agi_v3.cpp	2007-06-06 13:30:47 UTC (rev 27135)
@@ -64,7 +64,7 @@
 
 		if (f.hasSuffix("vol.0")) {
 			memset(_vm->_game.name, 0, 8);
-			strncpy(_vm->_game.name, f.c_str(), f.size() > 5 ? f.size() - 5 : f.size());
+			strncpy(_vm->_game.name, f.c_str(), MAX((uint)8, f.size() > 5 ? f.size() - 5 : f.size()));
 			debugC(3, kDebugLevelMain, "game.name = %s", _vm->_game.name);
 			_intVersion = 0x3149;	// setup for 3.002.149
 			ec = _vm->v3IdGame();


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