From 53e3e587a9bf08ed74527e81c4a01ec933706a26 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 22 Sep 2006 13:52:29 +0000 Subject: 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 --- libiberty/cp-demangle.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libiberty/cp-demangle.c') 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 != '_'); -- cgit v1.1