summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/char_sql/char.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 464827e39..0ddf1f0a4 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,9 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2007/10/07
+ * Fixed a bug on sql char server not checking the namelength of a new
+ character. Bug ID #184: Char Creation With An Empty Name [Zephyrus]
2007/10/06
* the mapserver won't exit when no mapcache is found, with use_grf: yes
* Fixed some \r uses, now looks better; /thx to Ai4rei (topic:165952)
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 0f42d3b96..873568896 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -1104,6 +1104,13 @@ int make_new_char_sql(int fd, unsigned char *dat)
ShowInfo("New character request (%d)\n", sd->account_id);
+ // check lenght of character name
+ if (strlen(name) < 4) {
+ char_log("Create char failed (character name too small): (connection #%d, account: %d, name: '%s').\n",
+ fd, sd->account_id, dat);
+ return -2;
+ }
+
//check name != main chat nick [LuzZza]
if(strcmpi(name, main_chat_nick) == 0) {
ShowInfo("Create char failed (%d): this nick (%s) reserved for mainchat messages.\n", sd->account_id, name);