* PR28753, buffer overflow in read_section_stabs_debugging_info
@ 2022-01-28 6:25 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-01-28 6:25 UTC (permalink / raw)
To: binutils
PR 28753
* rddbg.c (read_section_stabs_debugging_info): Don't read past
end of section when concatentating stab strings.
diff --git a/binutils/rddbg.c b/binutils/rddbg.c
index 42605b83d1a..169c52f4983 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;
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-28 6:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28 6:25 PR28753, buffer overflow in read_section_stabs_debugging_info Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).