From d0725afa8363b5f7b0612e087b48013d39339039 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 18 Jan 2015 11:37:45 -0200 Subject: Fixing 38 issues Addressing out of bounds read/write, pointless null checks on already deferenced variables, dead code. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind --- src/char/char.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/char/char.c') diff --git a/src/char/char.c b/src/char/char.c index 1d9d1d65c..3d328efa9 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3009,12 +3009,12 @@ void char_send_maps(int fd, int id, int j) // Transmitting the maps of the other map-servers to the new map-server for(x = 0; x < ARRAYLENGTH(chr->server); x++) { if (chr->server[x].fd > 0 && x != id) { - WFIFOHEAD(fd,10 +4*ARRAYLENGTH(chr->server[x].map)); + WFIFOHEAD(fd,10 +4*chr->server[x].maps); WFIFOW(fd,0) = 0x2b04; WFIFOL(fd,4) = htonl(chr->server[x].ip); WFIFOW(fd,8) = htons(chr->server[x].port); j = 0; - for(i = 0; i < ARRAYLENGTH(chr->server[x].map); i++) + for(i = 0; i < chr->server[x].maps; i++) if (chr->server[x].map[i]) WFIFOW(fd,10+(j++)*4) = chr->server[x].map[i]; if (j > 0) { -- cgit v1.2.3-60-g2f50