]> git.saurik.com Git - wxWidgets.git/commitdiff
use a constant instead of hardcoded value
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 29 Jun 2005 22:05:08 +0000 (22:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 29 Jun 2005 22:05:08 +0000 (22:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/debughlp.cpp

index 3752aa10b27fb5fd7eb2d91fd81ba07c47589e0a..ecd2d61246a0e55e92f0c376f772515d9c7e968b 100644 (file)
 
 #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;
     }