cplus-dem.c (demangle_qualified): Fix off-by-one when checking range of 'K' index.
authorAndreas Schwab <schwab@issan.cs.uni-dortmund.de>
Tue, 20 Oct 1998 12:30:45 +0000 (12:30 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Tue, 20 Oct 1998 12:30:45 +0000 (12:30 +0000)
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

libiberty/ChangeLog
libiberty/cplus-dem.c

index 271b859c4e5984c79d3afaac3168d247cee0d10c..bbc34726c874f2b424ce516b2bc9f94a4b2f8b36 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 Thu Oct 15 18:51:12 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * choose-temp.c: Prototype mkstemps() when IN_GCC.
index 079c8a77d223ced27338a1431fcf789fc64b9561..35e49384ad2a604bc4e35bc5c89adb8d0906a2b5 100644 (file)
@@ -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]);