From 29de937a2d8b485498fa9ce573efebfb64e8d669 Mon Sep 17 00:00:00 2001 From: panikon Date: Wed, 9 Jul 2014 00:19:37 -0300 Subject: Fixed status_calc_regen crash issue:http://hercules.ws/board/tracker/issue-1298-mapserver-crashed-item-check/ Follow up to 7cd967f812ab741c41c416fb9f7c2a921c36e947 --- src/common/sysinfo.h | 4 ++++ src/map/packets_struct.h | 3 +++ src/map/status.c | 1 + 3 files changed, 8 insertions(+) diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h index 97f14d0f2..24f794cb4 100644 --- a/src/common/sysinfo.h +++ b/src/common/sysinfo.h @@ -21,7 +21,11 @@ struct sysinfo_private; struct sysinfo_interface { struct sysinfo_private *p; +#if defined(WIN32) && !defined(__CYGWIN__) long (*getpagesize) (void); +#else + int (*getpagesize) (void); +#endif const char *(*platform) (void); const char *(*osversion) (void); const char *(*cpu) (void); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 3d49944d1..403ab6fa3 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -943,6 +943,9 @@ struct packet_npc_market_open { unsigned int price; unsigned int qty; unsigned short view; + // It seems that the client doesn't have any hard-coded limit for this list + // it's possible to send up to 1890 items without dropping a packet that's + // too large [Panikon] } list[1000];/* TODO: whats the actual max of this? */ } __attribute__((packed)); diff --git a/src/map/status.c b/src/map/status.c index d108d8cfa..499c50e3b 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3413,6 +3413,7 @@ int status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt) { void status_calc_regen(struct block_list *bl, struct status_data *st, struct regen_data *regen) { struct map_session_data *sd; int val, skill_lv, reg_flag; + nullpo_retv(bl); if( !(bl->type&BL_REGEN) || !regen ) return; -- cgit v1.2.3-60-g2f50