From 348044f12d5f683c8945e0eac642f2795050fb4e Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 17 Jan 2015 17:43:18 -0200 Subject: Another ~10 Fixes Addressing out of bounds read/write, resource leaks. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind --- src/map/clif.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 4e55a515b..31f7961d5 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -13884,7 +13884,8 @@ void clif_parse_PMIgnore(int fd, struct map_session_data* sd) { return; } // move everything one place down to overwrite removed entry - memmove(sd->ignore[i].name, sd->ignore[i+1].name, (MAX_IGNORE_LIST-i-1)*sizeof(sd->ignore[0].name)); + if( i != MAX_IGNORE_LIST - 1 ) + memmove(sd->ignore[i].name, sd->ignore[i+1].name, (MAX_IGNORE_LIST-i-1)*sizeof(sd->ignore[0].name)); // wipe last entry memset(sd->ignore[MAX_IGNORE_LIST-1].name, 0, sizeof(sd->ignore[0].name)); } @@ -17747,7 +17748,7 @@ void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) { short tab = RFIFOW(fd, 2); int j; - if( tab < 0 || tab > CASHSHOP_TAB_MAX || clif->cs.item_count[tab] == 0 ) + if( tab < 0 || tab >= CASHSHOP_TAB_MAX || clif->cs.item_count[tab] == 0 ) return; WFIFOHEAD(fd, 10 + ( clif->cs.item_count[tab] * 6 ) ); -- cgit v1.2.3-70-g09d2