]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libiberty/cplus-dem.c
cplus-dem.c (demangle_qualified): Fix off-by-one when checking range of 'K' index.
[thirdparty/gcc.git] / libiberty / cplus-dem.c
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]);