summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@users.noreply.github.com>2014-06-07 16:39:09 -0300
committershennetsind <shennetsind@users.noreply.github.com>2014-06-07 16:39:09 -0300
commit439434a6dedd1326d28f01cac5077ecdb0e3519c (patch)
tree0d875391f5c6918bfbaad4359f3bc8168bc7f9be
parent60e367824750a3e2498a78b3d78367c0b8a499de (diff)
parent0fd3edabda22ce91183c9ae97a5bf80c26ebd550 (diff)
downloadhercules-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.c10
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;