diff options
author | shennetsind <ind@henn.et> | 2013-10-11 14:07:15 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-10-11 14:07:15 -0300 |
commit | fad3040499293b1ff4ff634680163fcab4ca5e70 (patch) | |
tree | 65fa32c8395714bc080043a9db537c33d2da9ff8 /src/login/login.c | |
parent | 231f7a4f31b27611af7006e3adc2d3c046356fd3 (diff) | |
download | hercules-fad3040499293b1ff4ff634680163fcab4ca5e70.tar.gz hercules-fad3040499293b1ff4ff634680163fcab4ca5e70.tar.bz2 hercules-fad3040499293b1ff4ff634680163fcab4ca5e70.tar.xz hercules-fad3040499293b1ff4ff634680163fcab4ca5e70.zip |
Fixed login packet 0x825
Special Thanks to Haru, Yommy.
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/login/login.c')
-rw-r--r-- | src/login/login.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/login/login.c b/src/login/login.c index b603117e4..f81ee30c7 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1383,11 +1383,11 @@ int parse_login(int fd) { uint32 version; char username[NAME_LENGTH]; - char password[NAME_LENGTH]; + char password[PASSWD_LEN]; unsigned char passhash[16]; uint8 clienttype; bool israwpass = (command==0x0064 || command==0x0277 || command==0x02b0 || command == 0x0825); - + // Shinryo: For the time being, just use token as password. if(command == 0x0825) { @@ -1397,15 +1397,14 @@ int parse_login(int fd) size_t uTokenLen = RFIFOREST(fd) - 0x5C; version = RFIFOL(fd,4); - - if(uAccLen > NAME_LENGTH - 1 || uAccLen <= 0 || uTokenLen > NAME_LENGTH - 1 || uTokenLen <= 0) - { + + if(uAccLen <= 0 || uTokenLen <= 0) { login_auth_failed(sd, 3); return 0; } - safestrncpy(username, accname, uAccLen + 1); - safestrncpy(password, token, uTokenLen + 1); + safestrncpy(username, accname, NAME_LENGTH); + safestrncpy(password, token, PASSWD_LEN); clienttype = RFIFOB(fd, 8); } else @@ -1431,7 +1430,7 @@ int parse_login(int fd) if( israwpass ) { ShowStatus("Request for connection of %s (ip: %s).\n", sd->userid, ip); - safestrncpy(sd->passwd, password, NAME_LENGTH); + safestrncpy(sd->passwd, password, PASSWD_LEN); if( login_config.use_md5_passwds ) MD5_String(sd->passwd, sd->passwd); sd->passwdenc = 0; |