From 7552d664e93bf93887e09a18f670cd667bb400d8 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Sun, 7 Oct 2007 20:46:50 +0000 Subject: - 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 --- Changelog-Trunk.txt | 3 +++ src/char_sql/char.c | 7 +++++++ 2 files changed, 10 insertions(+) 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); -- cgit v1.2.3-70-g09d2