diff options
author | Andrei Karas <akaras@inbox.ru> | 2020-04-15 05:23:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2020-05-04 01:00:43 +0300 |
commit | a9c3213e475fd5463d1978c443099d1fbefe0d5c (patch) | |
tree | 9bad61ad3a3289b37afbc3379f7e290b746fe56c | |
parent | decca97db265de6be348e3c9e6a4adab49c2a143 (diff) | |
download | hercules-a9c3213e475fd5463d1978c443099d1fbefe0d5c.tar.gz hercules-a9c3213e475fd5463d1978c443099d1fbefe0d5c.tar.bz2 hercules-a9c3213e475fd5463d1978c443099d1fbefe0d5c.tar.xz hercules-a9c3213e475fd5463d1978c443099d1fbefe0d5c.zip |
Fix security check in lapin ack packet handler
-rw-r--r-- | src/map/clif.c | 5 | ||||
-rw-r--r-- | src/map/pc.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 2b044a2d7..d69508b8e 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -23797,12 +23797,15 @@ static void clif_parse_lapineDdukDdak_ack(int fd, struct map_session_data *sd) _ static void clif_parse_lapineDdukDdak_ack(int fd, struct map_session_data *sd) { #if PACKETVER >= 20160302 + if (sd->state.lapine_ui == 0) + return; + const struct PACKET_CZ_LAPINEDDUKDDAK_ACK *p = RP2PTR(fd); struct item_data *it = itemdb->exists(p->itemId); if (it == NULL || it->lapineddukddak == NULL) return; - if (pc_cant_act(sd)) + if (pc_cant_act_except_lapine(sd)) return; if (pc->search_inventory(sd, it->nameid) == INDEX_NOT_FOUND) return; diff --git a/src/map/pc.h b/src/map/pc.h index 728c91669..f6c7a0947 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -678,6 +678,7 @@ END_ZEROED_BLOCK; #define pc_isidle(sd) ( (sd)->chat_id != 0 || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(sockt->last_tick, (sd)->idletime) >= battle->bc->idle_no_share ) #define pc_istrading(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->state.trading ) #define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1) +#define pc_cant_act_except_lapine(sd) ((sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1) /* equals pc_cant_act except it doesn't check for chat rooms */ #define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1) |