summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-28 17:37:54 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-28 17:37:54 +0000
commit612b4e41860672a52788c7adb66fdaa89f0e29ae (patch)
tree4963e0cd1c46a07d43b85d42946c86696afe4423 /src/login
parent5f3bea3ba98249acae12a9b14981b1fcdbcc9890 (diff)
downloadhercules-612b4e41860672a52788c7adb66fdaa89f0e29ae.tar.gz
hercules-612b4e41860672a52788c7adb66fdaa89f0e29ae.tar.bz2
hercules-612b4e41860672a52788c7adb66fdaa89f0e29ae.tar.xz
hercules-612b4e41860672a52788c7adb66fdaa89f0e29ae.zip
Fixed a txt login server crash when reading a malformed accounts file.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13149 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login')
-rw-r--r--src/login/account_txt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/login/account_txt.c b/src/login/account_txt.c
index 23231d810..4b4e4b950 100644
--- a/src/login/account_txt.c
+++ b/src/login/account_txt.c
@@ -127,12 +127,14 @@ static bool account_db_txt_init(AccountDB* self)
if( line[0] == '/' && line[1] == '/' )
continue;
+ int n = 0;
if( sscanf(line, "%d%n", &v, &n) == 1 && (line[n] == '\n' || line[n] == '\r') )
{// format version definition
version = v;
continue;
}
+ int n = 0;
if( sscanf(line, "%d\t%%newid%%%n", &account_id, &n) == 1 && (line[n] == '\n' || line[n] == '\r') )
{// auto-increment
if( account_id > db->next_account_id )