Просмотр исходного кода

1/2/3-letter char name creation exploit fix.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15169 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 лет назад
Родитель
Сommit
624ea1e233
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      src/char_sql/char.c

+ 6 - 1
src/char_sql/char.c

@@ -1293,7 +1293,12 @@ int check_char_name(char * name, char * esc_name)
 	// check length of character name
 	if( name[0] == '\0' )
 		return -2; // empty character name
-
+	/**
+	 * The client does not allow you to create names with less than 4 characters, however,
+	 * the use of WPE can bypass this, and this fixes the exploit.
+	 **/
+	if( strlen( name ) < 4 )
+		return -2;
 	// check content of character name
 	if( remove_control_chars(name) )
 		return -2; // control chars in name