projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a8b54a
)
Re: Sanity check read_section_stabs_debugging_info
author
Alan Modra
<amodra@gmail.com>
Tue, 14 Mar 2023 23:56:24 +0000
(10:26 +1030)
committer
Alan Modra
<amodra@gmail.com>
Thu, 16 Mar 2023 00:41:44 +0000
(11:11 +1030)
* rddbg.c (read_section_stabs_debugging_info): Don't segfault on
zero size string section.
binutils/rddbg.c
patch
|
blob
|
history
diff --git
a/binutils/rddbg.c
b/binutils/rddbg.c
index f2ed6bcb3ddc9fc0014b59deb84f7a84f9434869..1a888778312e218629769bab69a1c0ba578d165e 100644
(file)
--- a/
binutils/rddbg.c
+++ b/
binutils/rddbg.c
@@
-147,7
+147,8
@@
read_section_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount,
}
/* Zero terminate the strings table, just in case. */
strsize = bfd_section_size (strsec);
- strings [strsize - 1] = 0;
+ if (strsize != 0)
+ strings [strsize - 1] = 0;
if (shandle == NULL)
{
shandle = start_stab (dhandle, abfd, true, syms, symcount);