diff options
author | Haru <haru@dotalux.com> | 2016-06-24 22:16:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-24 22:16:59 +0200 |
commit | 7952c1fe1f92b7b4907545c6b24ccfc383c87555 (patch) | |
tree | 0ab8286a593d386290ca932bedc87151da854bcd /src/map/path.c | |
parent | 538d2a20c69523cde59e1ecd74f1d76d6ba64f24 (diff) | |
parent | 093d91429e09cd1c30b95bf4de68603d773248ef (diff) | |
download | hercules-7952c1fe1f92b7b4907545c6b24ccfc383c87555.tar.gz hercules-7952c1fe1f92b7b4907545c6b24ccfc383c87555.tar.bz2 hercules-7952c1fe1f92b7b4907545c6b24ccfc383c87555.tar.xz hercules-7952c1fe1f92b7b4907545c6b24ccfc383c87555.zip |
Merge pull request #1322 from 4144/mapchecks
Add missing checks into some files in map server
Diffstat (limited to 'src/map/path.c')
-rw-r--r-- | src/map/path.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/map/path.c b/src/map/path.c index 0df9708d8..379532681 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -89,6 +89,7 @@ int path_blownpos(struct block_list *bl, int16 m,int16 x0,int16 y0,int16 dx,int1 { struct map_data *md; + Assert_retr(-1, m < 0 || m >= map->count); if( !map->list[m].cell ) return -1; md = &map->list[m]; @@ -126,6 +127,8 @@ bool path_search_long(struct shootpath_data *spd,struct block_list *bl,int16 m,i struct map_data *md; struct shootpath_data s_spd; + Assert_retr(false, m < 0 || m >= map->count); + if( spd == NULL ) spd = &s_spd; // use dummy output variable @@ -258,6 +261,8 @@ bool path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int1 struct map_data *md; struct walkpath_data s_wpd; + Assert_retr(false, m < 0 || m >= map->count); + if (wpd == NULL) wpd = &s_wpd; // use dummy output variable |