summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2015-01-18 11:37:45 -0200
committershennetsind <ind@henn.et>2015-01-18 11:37:45 -0200
commitd0725afa8363b5f7b0612e087b48013d39339039 (patch)
tree3f521b45f4b0f0d3e7dee31cacfdd78d7be867ab /src/char/char.c
parenta3c4d675ba19df385be5d1e3966c61de7186da57 (diff)
downloadhercules-d0725afa8363b5f7b0612e087b48013d39339039.tar.gz
hercules-d0725afa8363b5f7b0612e087b48013d39339039.tar.bz2
hercules-d0725afa8363b5f7b0612e087b48013d39339039.tar.xz
hercules-d0725afa8363b5f7b0612e087b48013d39339039.zip
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 <ind@henn.et>
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c4
1 files changed, 2 insertions, 2 deletions
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) {