Skip to content

Commit d56e433

Browse files
committed
Re: Sanity check read_section_stabs_debugging_info
* rddbg.c (read_section_stabs_debugging_info): Don't segfault on zero size string section.
1 parent 5a8b54a commit d56e433

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

binutils/rddbg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ read_section_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount,
147147
}
148148
/* Zero terminate the strings table, just in case. */
149149
strsize = bfd_section_size (strsec);
150-
strings [strsize - 1] = 0;
150+
if (strsize != 0)
151+
strings [strsize - 1] = 0;
151152
if (shandle == NULL)
152153
{
153154
shandle = start_stab (dhandle, abfd, true, syms, symcount);

0 commit comments

Comments
 (0)