diff options
author | shennetsind <ind@henn.et> | 2015-01-17 17:43:18 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2015-01-17 17:43:18 -0200 |
commit | 348044f12d5f683c8945e0eac642f2795050fb4e (patch) | |
tree | 0f481175cd4d4056ef0859c637a3b0c2df159854 /src/map/clif.c | |
parent | f0ea100d5ccc03d8f94b67ea9d3ffa82fcd937b1 (diff) | |
download | hercules-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.c | 5 |
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 ) ); |