aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-01-20 13:58:38 +1030
committerAlan Modra <amodra@gmail.com>2022-01-28 11:54:54 +1030
commit085b299b71721e15f5c5c5344dc3e4e4536dadba (patch)
tree068e406018c27f6ab27fd5b2e96dc7af3b2c8795 /binutils
parent1f01799f55cd1999fe9618928eed70a4cddec6fd (diff)
downloadgdb-085b299b71721e15f5c5c5344dc3e4e4536dadba.zip
gdb-085b299b71721e15f5c5c5344dc3e4e4536dadba.tar.gz
gdb-085b299b71721e15f5c5c5344dc3e4e4536dadba.tar.bz2
PR28753, buffer overflow in read_section_stabs_debugging_info
PR 28753 * rddbg.c (read_section_stabs_debugging_info): Don't read past end of section when concatentating stab strings.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/rddbg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/binutils/rddbg.c b/binutils/rddbg.c
index 42605b8..169c52f 100644
--- a/binutils/rddbg.c
+++ b/binutils/rddbg.c
@@ -210,7 +210,7 @@ read_section_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount,
an attempt to read the byte before 'strings' would occur. */
while ((len = strlen (s)) > 0
&& s[len - 1] == '\\'
- && stab + 12 < stabs + stabsize)
+ && stab + 16 <= stabs + stabsize)
{
char *p;