summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-08-09 09:44:22 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-08-09 09:44:22 +0000
commit380d7112b68f9670e63c0ff0fbaf3cccb40e40b0 (patch)
treec83bc69fc59bfa5c06e14740971231c1f27b83b8 /gnu/usr.bin/binutils
parentc895e6d88f1a41c252ca761f25f081a86c918417 (diff)
Do not access s[strlen(s) - 1] without checking first that s is not an
empty string.
Diffstat (limited to 'gnu/usr.bin/binutils')
-rw-r--r--gnu/usr.bin/binutils/binutils/rddbg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils/binutils/rddbg.c b/gnu/usr.bin/binutils/binutils/rddbg.c
index 75ddab54488..4abdd23d1dd 100644
--- a/gnu/usr.bin/binutils/binutils/rddbg.c
+++ b/gnu/usr.bin/binutils/binutils/rddbg.c
@@ -191,7 +191,7 @@ read_section_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount,
s = (char *) strings + stroff + strx;
- while (s[strlen (s) - 1] == '\\'
+ while (*s != '\0' && s[strlen (s) - 1] == '\\'
&& stab + 12 < stabs + stabsize)
{
char *p;