gcc2 demangler: Fix skip of string termination.

The inner loop to skip the function declaration stops at the
terminating null but didn't break out of the loop in that case, causing
the outer loop increment to skip the terminator and read beyond the
string end.

Well formatted symbols do not trigger this, but there sometimes are
false positives that would cause it to happen. It was seen in Debugger
that reuses this code.
This commit is contained in:
Michael Lotz 2015-04-04 10:34:07 +02:00
parent 5ecdb49e5f
commit 23a1bcf28b

View File

@ -43,6 +43,9 @@ ignore_qualifiers(const char** _arg)
// skip function declaration
while (**_arg && **_arg != '_')
(*_arg)++;
if (**_arg == 0)
break;
}
(*_arg)++;