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
This commit is contained in:
jimblandy@gmail.com 2009-12-15 16:34:02 +00:00
parent bb846bdc98
commit 0397da8e08

View file

@ -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;
}