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/map/clif.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index ae6b6d939..57e01278b 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -404,6 +404,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target case AREA_WOSC: if (sd && bl->prev == NULL) //Otherwise source misses the packet.[Skotlex] clif->send (buf, len, bl, SELF); + /* Fall through */ case AREA_WOC: case AREA_WOS: map->foreachinarea(clif->send_sub, bl->m, bl->x-AREA_SIZE, bl->y-AREA_SIZE, bl->x+AREA_SIZE, bl->y+AREA_SIZE, @@ -443,6 +444,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target y0 = bl->y - AREA_SIZE; x1 = bl->x + AREA_SIZE; y1 = bl->y + AREA_SIZE; + /* Fall through */ case PARTY: case PARTY_WOS: case PARTY_SAMEMAP: @@ -518,6 +520,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target y0 = bl->y - AREA_SIZE; x1 = bl->x + AREA_SIZE; y1 = bl->y + AREA_SIZE; + /* Fall through */ case GUILD_SAMEMAP: case GUILD_SAMEMAP_WOS: case GUILD: @@ -569,6 +572,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target y0 = bl->y - AREA_SIZE; x1 = bl->x + AREA_SIZE; y1 = bl->y + AREA_SIZE; + /* Fall through */ case BG_SAMEMAP: case BG_SAMEMAP_WOS: case BG: @@ -5629,7 +5633,7 @@ void clif_displaymessage2(const int fd, const char* mes) { nullpo_retv(mes); //Scrapped, as these are shared by disconnected players =X [Skotlex] - if (fd == 0) + if (fd == 0 && !map->cpsd_active) ; else { // Limit message to 255+1 characters (otherwise it causes a buffer overflow in the client) -- cgit v1.2.3-60-g2f50