From: Vadim Zeitlin Date: Wed, 29 Jun 2005 22:05:08 +0000 (+0000) Subject: use a constant instead of hardcoded value X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/97799a969b514d215483d3c0106e65654dde8acf use a constant instead of hardcoded value git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/debughlp.cpp b/src/msw/debughlp.cpp index 3752aa10b2..ecd2d61246 100644 --- a/src/msw/debughlp.cpp +++ b/src/msw/debughlp.cpp @@ -27,6 +27,14 @@ #if wxUSE_DBGHELP +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +// to prevent recursion which could result from corrupted data we limit +// ourselves to that many levels of embedded fields inside structs +static const unsigned MAX_DUMP_DEPTH = 20; + // ---------------------------------------------------------------------------- // globals // ---------------------------------------------------------------------------- @@ -286,7 +294,7 @@ wxDbgHelpDLL::DumpField(PSYMBOL_INFO pSym, void *pVariable, unsigned level) wxString s; // avoid infinite recursion - if ( level > 100 ) + if ( level > MAX_DUMP_DEPTH ) { return s; }