stop after at most 200 iterations in WalkFrom() to avoid looping endlessly when the stack is corrupted (patch 1759239)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47767 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-07-28 00:16:55 +00:00
parent d6c69e0dec
commit e97b634c4c

View File

@@ -266,8 +266,9 @@ void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip)
#error "Need to initialize STACKFRAME on non x86" #error "Need to initialize STACKFRAME on non x86"
#endif // _M_IX86 #endif // _M_IX86
// iterate over all stack frames // iterate over all stack frames (but stop after 200 to avoid entering
for ( size_t nLevel = 0; ; nLevel++ ) // infinite loop if the stack is corrupted)
for ( size_t nLevel = 0; nLevel < 200; nLevel++ )
{ {
// get the next stack frame // get the next stack frame
if ( !wxDbgHelpDLL::StackWalk if ( !wxDbgHelpDLL::StackWalk