aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cplus-dem.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@issan.cs.uni-dortmund.de>1998-10-20 12:30:45 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>1998-10-20 12:30:45 +0000
commite0c13971dfc368280e833250074e0f6ebd4a7a29 (patch)
treeb17d6aa9d0afb230e808affe9900e777d6e4435d /libiberty/cplus-dem.c
parentb351b287b70b47f67c310858202042d6b270938a (diff)
downloadgcc-e0c13971dfc368280e833250074e0f6ebd4a7a29.zip
gcc-e0c13971dfc368280e833250074e0f6ebd4a7a29.tar.gz
gcc-e0c13971dfc368280e833250074e0f6ebd4a7a29.tar.bz2
cplus-dem.c (demangle_qualified): Fix off-by-one when checking range of 'K' index.
Tue Oct 20 12:29:02 1998 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * cplus-dem.c (demangle_qualified): Fix off-by-one when checking range of 'K' index. From-SVN: r23202
Diffstat (limited to 'libiberty/cplus-dem.c')
-rw-r--r--libiberty/cplus-dem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 079c8a7..35e4938 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -2271,7 +2271,7 @@ demangle_qualified (work, mangled, result, isfuncname, append)
int idx;
(*mangled)++;
idx = consume_count_with_underscores (mangled);
- if (idx == -1 || idx > work -> numk)
+ if (idx == -1 || idx >= work -> numk)
success = 0;
else
string_append (&temp, work -> ktypevec[idx]);
@@ -2359,7 +2359,7 @@ demangle_qualified (work, mangled, result, isfuncname, append)
int idx;
(*mangled)++;
idx = consume_count_with_underscores (mangled);
- if (idx == -1 || idx > work->numk)
+ if (idx == -1 || idx >= work->numk)
success = 0;
else
string_append (&temp, work->ktypevec[idx]);