From 99d49adad5b86452fbe74b48931ad8b338d4ddea Mon Sep 17 00:00:00 2001 From: entryway Date: Sat, 27 Mar 2010 19:34:43 +0000 Subject: [PATCH] Check for blockmap overflow in P_BlockLinesIterator. Under RANGECHECK define. --- src/p_maputl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index 339437e6d..5beee5f36 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -972,6 +972,10 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *)) // First index is really empty, so +1 it. for (list = blockmaplump + offset + 1; *list != -1; list++) { +#ifdef RANGECHECK + if (*list < 0 || (UINT32)*list >= numlines) + I_Error("P_BlockLinesIterator: index >= numlines"); +#endif ld = &lines[*list]; if (ld->validcount == validcount)