From c23c69d1314967be985306e41138ad23e73c5cfe Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Fri, 17 Sep 2021 08:08:52 +0100 Subject: [PATCH] Fix OOB in TEST(PathTest, Solid) --- Source/path.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/path.cpp b/Source/path.cpp index ac365f0e9..f8e92bb0f 100644 --- a/Source/path.cpp +++ b/Source/path.cpp @@ -285,6 +285,10 @@ bool GetPath(const std::function &posOk, PATHNODE *pPath, Point des bool IsTileNotSolid(Point position) { + if (position.x < 0 || position.y < 0 || position.x >= MAXDUNX || position.y >= MAXDUNY) { + return false; + } + return !nSolidTable[dPiece[position.x][position.y]]; }