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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Sep 30 17:43:28 CEST 2009


Revision: 44491
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44491&view=rev
Author:   thebluegr
Date:     2009-09-30 15:43:28 +0000 (Wed, 30 Sep 2009)

Log Message:
-----------
Fixed a crash in KQ1SCI, when the user types something wrong - the game tries to open a file with an empty file name, and an odd file mode

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

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2009-09-30 15:21:44 UTC (rev 44490)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2009-09-30 15:43:28 UTC (rev 44491)
@@ -753,6 +753,10 @@
 		Common::String name = s->segMan->getString(argv[1]);
 		int mode = argv[2].toUint16();
 
+		if (name.empty()) {
+			warning("Attempted to open a file with an empty filename");
+			return make_reg(0, SIGNAL_OFFSET);
+		}
 		file_open(s, name.c_str(), mode);
 		debug(3, "K_FILEIO_OPEN(%s,0x%x)", name.c_str(), mode);
 		break;


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