diff options
author | Ibrahim Hossam <ibrahem.h.basyone@gmail.com> | 2014-06-06 04:35:28 +0300 |
---|---|---|
committer | Ibrahim Hossam <ibrahem.h.basyone@gmail.com> | 2014-06-06 04:35:28 +0300 |
commit | 0fd3edabda22ce91183c9ae97a5bf80c26ebd550 (patch) | |
tree | db2d5fd49c645d429f90fd52ce0e0026e68b4f20 | |
parent | 17382d380c0476ffc5616d8e34b299c4bc485be7 (diff) | |
download | hercules-0fd3edabda22ce91183c9ae97a5bf80c26ebd550.tar.gz hercules-0fd3edabda22ce91183c9ae97a5bf80c26ebd550.tar.bz2 hercules-0fd3edabda22ce91183c9ae97a5bf80c26ebd550.tar.xz hercules-0fd3edabda22ce91183c9ae97a5bf80c26ebd550.zip |
Fixed garbage memory in the accinfo packet
-rw-r--r-- | src/login/login.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/login/login.c b/src/login/login.c index c3f2f6000..1db92fda6 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -845,18 +845,20 @@ int parse_fromchar(int fd) WFIFOHEAD(fd,183); WFIFOW(fd,0) = 0x2737; safestrncpy((char*)WFIFOP(fd,2), acc.userid, NAME_LENGTH); - if (u_group >= acc.group_id) { + if (u_group >= acc.group_id) safestrncpy((char*)WFIFOP(fd,26), acc.pass, 33); - } + else + memset(WFIFOP(fd,26), '\0', 33); safestrncpy((char*)WFIFOP(fd,59), acc.email, 40); safestrncpy((char*)WFIFOP(fd,99), acc.last_ip, 16); WFIFOL(fd,115) = acc.group_id; safestrncpy((char*)WFIFOP(fd,119), acc.lastlogin, 24); WFIFOL(fd,143) = acc.logincount; WFIFOL(fd,147) = acc.state; - if (u_group >= acc.group_id) { + if (u_group >= acc.group_id) safestrncpy((char*)WFIFOP(fd,151), acc.pincode, 5); - } + else + memset(WFIFOP(fd,151), '\0', 5); safestrncpy((char*)WFIFOP(fd,156), acc.birthdate, 11); WFIFOL(fd,167) = map_fd; WFIFOL(fd,171) = u_fd; |