From 92134dc19b4bf6407a88a306b771c9c6c88658d6 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 14 Feb 2017 14:17:09 +0000 Subject: [PATCH] Fix an illegal memory access parsing corrupt STABD debug information. PR binutils/21158 * rddbg.c (read_symbol_stabs_debugging_info): Check for a null or empty symbol name. --- binutils/ChangeLog | 6 ++++++ binutils/rddbg.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 99774b6b934..4f9bdfa75dc 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2017-02-14 Nick Clifton + + PR binutils/21158 + * rddbg.c (read_symbol_stabs_debugging_info): Check for a null or + empty symbol name. + 2017-02-14 Nick Clifton PR binutils/21157 diff --git a/binutils/rddbg.c b/binutils/rddbg.c index ae25decd654..1d8c4471887 100644 --- a/binutils/rddbg.c +++ b/binutils/rddbg.c @@ -299,7 +299,10 @@ read_symbol_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount, *pfound = TRUE; s = i.name; + if (s == NULL || strlen (s) < 1) + return FALSE; f = NULL; + while (s[strlen (s) - 1] == '\\' && ps + 1 < symend) { -- 2.30.2