From e3afe22a484a30ee1dbee950cc0b2d2f2c5baf4b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 11 Sep 2005 05:43:17 +0000 Subject: [PATCH] Fixed initialization bug in native filters Fixed bug where address boundaries were not checked on arrays --- amxmodx/debugger.cpp | 3 +++ amxmodx/debugger.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/amxmodx/debugger.cpp b/amxmodx/debugger.cpp index e719a867..4c760a81 100755 --- a/amxmodx/debugger.cpp +++ b/amxmodx/debugger.cpp @@ -548,6 +548,9 @@ int Debugger::FormatError(char *buffer, size_t maxLength) } else if (v_class == 0) { p_addr = (cell *)(data + pSymbol->address); } + //make sure our address is in bounds! + if (arr_addr < p_addr || arr_addr > (p_addr + size)) + continue; int *sizes = new int[pSymbol->dim]; int *indexes = new int[pSymbol->dim]; for (int i=0; idim; i++) diff --git a/amxmodx/debugger.h b/amxmodx/debugger.h index b8d4c376..371c1209 100755 --- a/amxmodx/debugger.h +++ b/amxmodx/debugger.h @@ -150,7 +150,7 @@ class Handler public: Handler(AMX *pAmx) : m_pAmx(pAmx), m_iErrFunc(-1), m_iModFunc(-1), m_iNatFunc(-1), - m_Handling(false) + m_Handling(false), m_InNativeFilter(false) { }; ~Handler() { }; public: