From 4597146d5a26105130d2181cfae5403bd3013366 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 30 Nov 2014 16:28:00 +0300 Subject: login: Fix possible overflow issue. --- src/login/send.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3-70-g09d2