aboutsummaryrefslogtreecommitdiff
path: root/binutils/rddbg.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-03-28 01:11:27 +0000
committerNick Clifton <nickc@redhat.com>2000-03-28 01:11:27 +0000
commit3b7aaf81e12ebca815b5f977369cd7a7681274db (patch)
treecb16c6071c72279445fa3e897645d9bda66fecb9 /binutils/rddbg.c
parentc247e9c435fff95b10e18adf7ef2c499e5387495 (diff)
downloadfsf-binutils-gdb-3b7aaf81e12ebca815b5f977369cd7a7681274db.zip
fsf-binutils-gdb-3b7aaf81e12ebca815b5f977369cd7a7681274db.tar.gz
fsf-binutils-gdb-3b7aaf81e12ebca815b5f977369cd7a7681274db.tar.bz2
catch out of range string offset in corrupt stab entry
Diffstat (limited to 'binutils/rddbg.c')
-rw-r--r--binutils/rddbg.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/binutils/rddbg.c b/binutils/rddbg.c
index 9428c37..e26056e 100644
--- a/binutils/rddbg.c
+++ b/binutils/rddbg.c
@@ -185,7 +185,17 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound)
char *f, *s;
f = NULL;
+
+ if (stroff + strx > strsize)
+ {
+ fprintf (stderr, "%s: %s: stab entry %d is corrupt, strx = 0x%x, type = %d\n",
+ bfd_get_filename (abfd), names[i].secname,
+ (stab - stabs) / 12, strx, type);
+ continue;
+ }
+
s = (char *) strings + stroff + strx;
+
while (s[strlen (s) - 1] == '\\'
&& stab + 12 < stabs + stabsize)
{