[Scummvm-cvs-logs] SF.net SVN: scummvm:[33438] scummvm/trunk/engines/tinsel/saveload.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Jul 30 10:23:04 CEST 2008


Revision: 33438
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33438&view=rev
Author:   thebluegr
Date:     2008-07-30 08:23:04 +0000 (Wed, 30 Jul 2008)

Log Message:
-----------
Make sure that save game descriptions are 0-terminated

Modified Paths:
--------------
    scummvm/trunk/engines/tinsel/saveload.cpp

Modified: scummvm/trunk/engines/tinsel/saveload.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/saveload.cpp	2008-07-30 07:58:25 UTC (rev 33437)
+++ scummvm/trunk/engines/tinsel/saveload.cpp	2008-07-30 08:23:04 UTC (rev 33438)
@@ -136,6 +136,7 @@
 	s.syncAsUint32LE(hdr.ver);
 
 	s.syncBytes((byte *)hdr.desc, SG_DESC_LEN);
+	hdr.desc[SG_DESC_LEN - 1] = 0;
 
 	syncTime(s, hdr.dateTime);
 
@@ -291,6 +292,7 @@
 
 		strncpy(savedFiles[i].name, fname.c_str(), FNAMELEN);
 		strncpy(savedFiles[i].desc, hdr.desc, SG_DESC_LEN);
+		savedFiles[i].desc[SG_DESC_LEN - 1] = 0;
 		savedFiles[i].dateTime = hdr.dateTime;
 
 		++numSfiles;
@@ -405,6 +407,7 @@
 	hdr.size = SAVEGAME_HEADER_SIZE;
 	hdr.ver = CURRENT_VER;
 	memcpy(hdr.desc, SaveSceneDesc, SG_DESC_LEN);
+	hdr.desc[SG_DESC_LEN - 1] = 0;
 	g_system->getTimeAndDate(hdr.dateTime);
 	if (!syncSaveGameHeader(s, hdr) || f->ioFailed()) {
 		goto save_failure;


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