[Scummvm-cvs-logs] SF.net SVN: scummvm: [25581] scummvm/trunk/engines/lure/strings.cpp

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Wed Feb 14 03:35:48 CET 2007


Revision: 25581
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25581&view=rev
Author:   dreammaster
Date:     2007-02-13 18:35:48 -0800 (Tue, 13 Feb 2007)

Log Message:
-----------
Added guard to prevent crashing if a hospot or character name is needed and was not provided

Modified Paths:
--------------
    scummvm/trunk/engines/lure/strings.cpp

Modified: scummvm/trunk/engines/lure/strings.cpp
===================================================================
--- scummvm/trunk/engines/lure/strings.cpp	2007-02-14 00:52:12 UTC (rev 25580)
+++ scummvm/trunk/engines/lure/strings.cpp	2007-02-14 02:35:48 UTC (rev 25581)
@@ -277,8 +277,11 @@
 			// Copy over hotspot or action 
 			ch = readCharacter();
 			const char *p = (ch == '1') ? hotspotName : characterName;
-			strcpy(destPos, p);
-			destPos += strlen(p);
+			if (p != NULL)
+			{
+				strcpy(destPos, p);
+				destPos += strlen(p);
+			}
 		} else if ((uint8) ch >= 0xa0) {
 			const char *p = getName((uint8) ch - 0xa0);
 			strcpy(destPos, p);


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