aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2006-09-22 13:52:29 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2006-09-22 13:52:29 +0000
commit53e3e587a9bf08ed74527e81c4a01ec933706a26 (patch)
tree4025b693fa73085b7f98c46439100a9b1d9680cc /libiberty/cp-demangle.c
parent2319ffbb7ae57cda5bb19ff0dae37443b71ae3ba (diff)
downloadgcc-53e3e587a9bf08ed74527e81c4a01ec933706a26.zip
gcc-53e3e587a9bf08ed74527e81c4a01ec933706a26.tar.gz
gcc-53e3e587a9bf08ed74527e81c4a01ec933706a26.tar.bz2
re PR other/29176 (Seg fault in demangler)
PR other/29176 * cp-demangle.c (d_substitution): Check for overflow when computing substitution index. From-SVN: r117144
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index c7ee878..2fa5978 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -2505,6 +2505,8 @@ d_substitution (struct d_info *di, int prefix)
id = id * 36 + c - 'A' + 10;
else
return NULL;
+ if (id < 0)
+ return NULL;
c = d_next_char (di);
}
while (c != '_');