[Scummvm-cvs-logs] SF.net SVN: scummvm:[50962] scummvm/trunk/engines/sci/engine

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Jul 17 19:58:50 CEST 2010


Revision: 50962
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50962&view=rev
Author:   m_kiewitz
Date:     2010-07-17 17:58:50 +0000 (Sat, 17 Jul 2010)

Log Message:
-----------
SCI: checking if within kernel function before overwrite a save (thx @ digitall)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kfile.cpp
    scummvm/trunk/engines/sci/engine/savegame.cpp

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2010-07-17 13:32:11 UTC (rev 50961)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2010-07-17 17:58:50 UTC (rev 50962)
@@ -531,6 +531,12 @@
 
 	debug(3, "kSaveGame(%s,%d,%s,%s)", game_id.c_str(), virtualId, game_description.c_str(), version.c_str());
 
+	// We check here, we don't want to delete a users save in case we are within a kernel function
+	if (s->executionStackBase) {
+		warning("kSaveGame - won't save from within kernel function");
+		return NULL_REG;
+	}
+
 	Common::Array<SavegameDesc> saves;
 	listSavegames(saves);
 

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2010-07-17 13:32:11 UTC (rev 50961)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2010-07-17 17:58:50 UTC (rev 50962)
@@ -722,6 +722,7 @@
 	meta.script0_size = script0->size;
 	meta.game_object_offset = g_sci->getGameObject().offset;
 
+	// Checking here again
 	if (s->executionStackBase) {
 		warning("Cannot save from below kernel function");
 		return false;


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