From 3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 17 Jan 2015 18:49:03 -0200 Subject: Another ~10 Fixes Addressing out of bounds read/write. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind --- src/map/path.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/map/path.c') diff --git a/src/map/path.c b/src/map/path.c index a7315da3c..600dfc082 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -255,6 +255,12 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x // Check destination cell if (x1 < 0 || x1 >= md->xs || y1 < 0 || y1 >= md->ys || md->getcellp(md,x1,y1,cell)) return false; + + if( x0 == x1 && y0 == y1 ) { + wpd->path_len = 0; + wpd->path_pos = 0; + return true; + } if (flag&1) { // Try finding direct path to target -- cgit v1.2.3-60-g2f50