aboutsummaryrefslogtreecommitdiff
path: root/src/google_breakpad/processor/stackwalker.h
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-08-26 21:38:51 +0000
committerthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-08-26 21:38:51 +0000
commit8e77c078d68ebd25d70f92f70a5aa630b19c7ee2 (patch)
treeb8db1ab22c61a7e3c8540c83c6a688d9c0606041 /src/google_breakpad/processor/stackwalker.h
parentIssue 176001: Add package to process_state.proto to prevent name clashes. (diff)
downloadbreakpad-8e77c078d68ebd25d70f92f70a5aa630b19c7ee2.tar.xz
Limit the number of frames we try to walk to prevent runaway processors.
Review URL: http://breakpad.appspot.com/175001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@672 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/google_breakpad/processor/stackwalker.h')
-rw-r--r--src/google_breakpad/processor/stackwalker.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/google_breakpad/processor/stackwalker.h b/src/google_breakpad/processor/stackwalker.h
index 3abcee75..36d721d1 100644
--- a/src/google_breakpad/processor/stackwalker.h
+++ b/src/google_breakpad/processor/stackwalker.h
@@ -48,7 +48,6 @@
namespace google_breakpad {
class CallStack;
-class CodeModule;
class CodeModules;
class MemoryRegion;
class MinidumpContext;
@@ -80,6 +79,9 @@ class Stackwalker {
SymbolSupplier *supplier,
SourceLineResolverInterface *resolver);
+ static void set_max_frames(u_int32_t max_frames) { max_frames_ = max_frames; }
+ static u_int32_t max_frames() { return max_frames_; }
+
protected:
// system_info identifies the operating system, NULL or empty if unknown.
// memory identifies a MemoryRegion that provides the stack memory
@@ -146,6 +148,10 @@ class Stackwalker {
// this in order to avoid repeatedly looking them up again within
// one minidump.
set<std::string> no_symbol_modules_;
+
+ // The maximum number of frames Stackwalker will walk through.
+ // This defaults to 1024 to prevent infinite loops.
+ static u_int32_t max_frames_;
};