Sfoglia il codice sorgente

* Fixed possible crash in script_reportdata, when a script string becomes NULL.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14731 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 anni fa
parent
commit
ffe2f08b20
2 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 2 0
      Changelog-Trunk.txt
  2. 8 1
      src/map/script.c

+ 2 - 0
Changelog-Trunk.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2011/03/05
+	* Fixed possible crash in script_reportdata, when a script string becomes NULL for whatever reason. [Ai4rei]
 2011/03/04
 	* Fixed recursive map_quit invocation when a buying store is auto-closed (login when @autotrade/logout) (bugreport:4796, since r14724). [Ai4rei]
 2011/03/02

+ 8 - 1
src/map/script.c

@@ -483,7 +483,14 @@ static void script_reportdata(struct script_data* data)
 		break;
 	case C_STR:
 	case C_CONSTSTR:// string
-		ShowDebug("Data: string value=\"%s\"\n", data->u.str);
+		if( data->u.str )
+		{
+			ShowDebug("Data: string value=\"%s\"\n", data->u.str);
+		}
+		else
+		{
+			ShowDebug("Data: string value=NULL\n");
+		}
 		break;
 	case C_NAME:// reference
 		if( reference_tovariable(data) )