summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2015-01-17 17:43:18 -0200
committershennetsind <ind@henn.et>2015-01-17 17:43:18 -0200
commit348044f12d5f683c8945e0eac642f2795050fb4e (patch)
tree0f481175cd4d4056ef0859c637a3b0c2df159854 /src/map/clif.c
parentf0ea100d5ccc03d8f94b67ea9d3ffa82fcd937b1 (diff)
downloadhercules-348044f12d5f683c8945e0eac642f2795050fb4e.tar.gz
hercules-348044f12d5f683c8945e0eac642f2795050fb4e.tar.bz2
hercules-348044f12d5f683c8945e0eac642f2795050fb4e.tar.xz
hercules-348044f12d5f683c8945e0eac642f2795050fb4e.zip
Another ~10 Fixes
Addressing out of bounds read/write, resource leaks. 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.c5
1 files changed, 3 insertions, 2 deletions
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 ) );