summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-07 20:46:50 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-07 20:46:50 +0000
commit7552d664e93bf93887e09a18f670cd667bb400d8 (patch)
tree981dbf0c2f60d02906b61a77c1fdc7b08bdad738
parent46277a00763ea482918a6e358de4fe0de51ef0c1 (diff)
downloadhercules-7552d664e93bf93887e09a18f670cd667bb400d8.tar.gz
hercules-7552d664e93bf93887e09a18f670cd667bb400d8.tar.bz2
hercules-7552d664e93bf93887e09a18f670cd667bb400d8.tar.xz
hercules-7552d664e93bf93887e09a18f670cd667bb400d8.zip
- Bug ID #184: Char Creation With An Empty Name [Zephyrus]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11377 54d463be-8e91-2dee-dedb-b68131a5f0ec
-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);