diff options
author | shennetsind <shennetsind@users.noreply.github.com> | 2014-06-07 16:39:09 -0300 |
---|---|---|
committer | shennetsind <shennetsind@users.noreply.github.com> | 2014-06-07 16:39:09 -0300 |
commit | 439434a6dedd1326d28f01cac5077ecdb0e3519c (patch) | |
tree | 0d875391f5c6918bfbaad4359f3bc8168bc7f9be | |
parent | 60e367824750a3e2498a78b3d78367c0b8a499de (diff) | |
parent | 0fd3edabda22ce91183c9ae97a5bf80c26ebd550 (diff) | |
download | hercules-439434a6dedd1326d28f01cac5077ecdb0e3519c.tar.gz hercules-439434a6dedd1326d28f01cac5077ecdb0e3519c.tar.bz2 hercules-439434a6dedd1326d28f01cac5077ecdb0e3519c.tar.xz hercules-439434a6dedd1326d28f01cac5077ecdb0e3519c.zip |
Merge pull request #291 from hemagx/master
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; |