aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2006-09-22 19:19:32 +0000
committerDJ Delorie <dj@redhat.com>2006-09-22 19:19:32 +0000
commite63f184e3f8cb7710ab1c76379c77a0728a6360a (patch)
tree31fd9095a450bb017faae093664579d25c00b87f /libiberty
parent5e02f92ecddc25fed29672c2002645eecfe59139 (diff)
downloadgdb-e63f184e3f8cb7710ab1c76379c77a0728a6360a.zip
gdb-e63f184e3f8cb7710ab1c76379c77a0728a6360a.tar.gz
gdb-e63f184e3f8cb7710ab1c76379c77a0728a6360a.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog6
-rw-r--r--libiberty/cp-demangle.c2
-rw-r--r--libiberty/testsuite/demangle-expected5
3 files changed, 13 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 0705a14..5081525 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,9 @@
+2006-09-22 Ian Lance Taylor <ian@airs.com>
+
+ PR other/29176
+ * cp-demangle.c (d_substitution): Check for overflow when
+ computing substitution index.
+
2006-08-30 Corinna Vinschen <corinna@vinschen.de>
* configure.ac: Add case for Mingw as host.
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 != '_');
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 4aaa3d6..3f5622f 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3811,3 +3811,8 @@ make<Factory, int>
_Z1fM1AKiPKS1_
f(int const A::*, int const A::* const*)
f
+# This used to cause a core dump in the demangler -- PR 29176
+--format=auto --no-params
+SASDASDFASDF_sdfsdf
+SASDASDFASDF_sdfsdf
+SASDASDFASDF_sdfsdf