From 0397da8e089e755cdfdd83348965a60f176dad14 Mon Sep 17 00:00:00 2001 From: "jimblandy@gmail.com" Date: Tue, 15 Dec 2009 16:34:02 +0000 Subject: [PATCH] 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 --- src/common/linux/stabs_reader.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; }