Explorar o código

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 %!s(int64=13) %!d(string=hai) anos
pai
achega
624ea1e233
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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