diff options
author | shennetsind <ind@henn.et> | 2015-01-18 11:37:45 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2015-01-18 11:37:45 -0200 |
commit | d0725afa8363b5f7b0612e087b48013d39339039 (patch) | |
tree | 3f521b45f4b0f0d3e7dee31cacfdd78d7be867ab /src/map/clif.c | |
parent | a3c4d675ba19df385be5d1e3966c61de7186da57 (diff) | |
download | hercules-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/map/clif.c')
-rw-r--r-- | src/map/clif.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) |