diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-30 16:28:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-30 16:28:00 +0300 |
commit | 4597146d5a26105130d2181cfae5403bd3013366 (patch) | |
tree | 8e28b7f29e0a42b0bec45b72ba221c866ee3fd9f /src | |
parent | 73b8dc48525960683da90286112e6740b3758101 (diff) | |
download | evol-hercules-4597146d5a26105130d2181cfae5403bd3013366.tar.gz evol-hercules-4597146d5a26105130d2181cfae5403bd3013366.tar.bz2 evol-hercules-4597146d5a26105130d2181cfae5403bd3013366.tar.xz evol-hercules-4597146d5a26105130d2181cfae5403bd3013366.zip |
login: Fix possible overflow issue.
Diffstat (limited to 'src')
-rw-r--r-- | src/login/send.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/login/send.c b/src/login/send.c index 3de3408..7bc08e4 100644 --- a/src/login/send.c +++ b/src/login/send.c @@ -29,10 +29,10 @@ void send_update_host(int fd) { if (!update_server) return; - const int sz = 4 + strlen(update_server); + const int sz = strlen(update_server); WFIFOHEAD(fd, sz); WFIFOW(fd, 0) = 0x63; - WFIFOW(fd, 2) = sz; + WFIFOW(fd, 2) = sz + 4; memcpy(WFIFOP (fd, 4), update_server, sz); - WFIFOSET(fd, sz); + WFIFOSET(fd, sz + 4); } |