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

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Jun 6 15:26:40 CEST 2007


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

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

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

Modified: scummvm/branches/branch-0-10-0/engines/agi/detection.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/engines/agi/detection.cpp	2007-06-06 13:25:48 UTC (rev 27132)
+++ scummvm/branches/branch-0-10-0/engines/agi/detection.cpp	2007-06-06 13:26:39 UTC (rev 27133)
@@ -1907,7 +1907,7 @@
 		for (IntMap::const_iterator f = allFiles.begin(); f != allFiles.end(); ++f) {
 			if (f->_key.hasSuffix("vol.0")) {
 				memset(name, 0, 8);
-				strncpy(name, f->_key.c_str(), f->_key.size() > 5 ? f->_key.size() - 5 : f->_key.size());
+				strncpy(name, f->_key.c_str(), MAX((uint)8, f->_key.size() > 5 ? f->_key.size() - 5 : f->_key.size()));
 
 				if (allFiles.contains("object") && allFiles.contains("words.tok") &&
 					allFiles.contains(Common::String(name) + "dir")) {


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