aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorjimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-12-15 16:34:02 +0000
committerjimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-12-15 16:34:02 +0000
commit0397da8e089e755cdfdd83348965a60f176dad14 (patch)
treef7cbed1fe54f6be4e5e8286e575bbb4ef734236e /src/common
parentIssue 25002: Linux symbol dumper: Require STABS consumers to provide a Warnin... (diff)
downloadbreakpad-0397da8e089e755cdfdd83348965a60f176dad14.tar.xz
Issue 25003: Linux dumper: Fix infinite loop in stabs parser.
If the input passed to a StabsReader instance contains a compilation unit whose first entry is an N_SO with no name, the parser enters an infinite loop. Since such entries mark the end of a compilation unit, ProcessCompilationUnit should skip them. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@443 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common')
-rw-r--r--src/common/linux/stabs_reader.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/linux/stabs_reader.cc b/src/common/linux/stabs_reader.cc
index 57073361..01c8341c 100644
--- a/src/common/linux/stabs_reader.cc
+++ b/src/common/linux/stabs_reader.cc
@@ -94,8 +94,13 @@ bool StabsReader::ProcessCompilationUnit() {
if (symbol_ >= symbols_end_ || symbol_->n_type != N_SO)
return true;
const char *name = SymbolString();
- if (name[0] == '\0')
+ if (name[0] == '\0') {
+ // This seems to be a stray end-of-compilation-unit marker;
+ // consume it, but don't report the end, since we didn't see a
+ // beginning.
+ symbol_++;
return true;
+ }
current_source_file_ = name;
}