* [binutils-gdb] asan: _bfd_stab_section_find_nearest_line segv
@ 2022-09-28 0:58 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-09-28 0:58 UTC (permalink / raw)
To: bfd-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8e4a500a5c4cef1aafc2c6e47cadd3dea0bfb99b
commit 8e4a500a5c4cef1aafc2c6e47cadd3dea0bfb99b
Author: Alan Modra <amodra@gmail.com>
Date: Wed Sep 28 09:52:22 2022 +0930
asan: _bfd_stab_section_find_nearest_line segv
The segv was on "info->strs[strsize - 1] = 0;" with strsize zero. OK,
if strsize is zero we don't have any filenames in stabs so no useful
info.
* syms.c (_bfd_stab_section_find_nearest_line): Exit if either
stabsize or strsize is zero.
Diff:
---
bfd/syms.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/bfd/syms.c b/bfd/syms.c
index ec62f3457ca..e8077f59bf0 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -1027,6 +1027,9 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
? info->strsec->rawsize
: info->strsec->size);
+ if (stabsize == 0 || strsize == 0)
+ goto out;
+
if (!bfd_malloc_and_get_section (abfd, info->stabsec, &info->stabs))
goto out;
if (!bfd_malloc_and_get_section (abfd, info->strsec, &info->strs))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-28 0:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 0:58 [binutils-gdb] asan: _bfd_stab_section_find_nearest_line segv 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).