Browse Source

Fixed an infinite loop if script name contains a single ':'

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9962 54d463be-8e91-2dee-dedb-b68131a5f0ec
toms 18 năm trước cách đây
mục cha
commit
5a7f6ded40
2 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 1 0
      Changelog-Trunk.txt
  2. 3 1
      src/map/npc.c

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2007/03/06
+	* Fixed an infinite loop if script name contains a single ':' [Toms]
 	* Simplified the Utsusemi/Bunsinjyutsu check to only block weapon skills
 	  that do not ignore offensive cards. [Skotlex]
 	* Added support for the 2 new packet versions. [Zephiris]

+ 3 - 1
src/map/npc.c

@@ -2077,8 +2077,10 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
 		nd->u.scr.ys = 0;
 	}
 
-	while ((p = strchr(w3,':'))) {
+	p = strchr(w3,':');
+	while (p) {
 		if (p[1] == ':') break;
+		p = strchr(p+1, ':');
 	}
 	if (p) {
 		*p = 0;