Bladeren bron

* Fixed char server crash when sending wisp with a "'" in the names

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1167 54d463be-8e91-2dee-dedb-b68131a5f0ec
celest 20 jaren geleden
bovenliggende
commit
09c783610d
2 gewijzigde bestanden met toevoegingen van 4 en 1 verwijderingen
  1. 1 0
      Changelog-SVN.txt
  2. 3 1
      src/char_sql/inter.c

+ 1 - 0
Changelog-SVN.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 02/23
+        * Fixed char server crash when sending wisp with a "'" in the names [celest]
         * Fixed Backstab not checking for and consuming arrows [celest]
         * Fixed another bad typo causing @allskill to not add points into advanced job
           skills [celest]

+ 3 - 1
src/char_sql/inter.c

@@ -423,6 +423,7 @@ int mapif_parse_GMmessage(int fd)
 int mapif_parse_WisRequest(int fd) {
 	struct WisData* wd;
 	static int wisid = 0;
+	char t_name[32];
 
 	if (RFIFOW(fd,2)-52 >= sizeof(wd->msg)) {
 		printf("inter: Wis message size too long.\n");
@@ -431,7 +432,8 @@ int mapif_parse_WisRequest(int fd) {
 		printf("inter: Wis message doesn't exist.\n");
 		return 0;
 	}
-	sprintf (tmp_sql, "SELECT `name` FROM `%s` WHERE `name`='%s'",char_db, RFIFOP(fd,28));
+	sprintf (tmp_sql, "SELECT `name` FROM `%s` WHERE `name`='%s'",
+		char_db, jstrescapecpy(t_name, (char *)RFIFOP(fd,28)));
 	if(mysql_query(&mysql_handle, tmp_sql) ) {
 		printf("DB server Error - %s\n", mysql_error(&mysql_handle) );
 	}