From de83eea5769c218a90751409b310f42c261e61c0 Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Sun, 28 May 2017 23:24:52 +0000 Subject: [PATCH] [ItaniumDemangle] Fix a exponential string copying bug This is a port of libcxxabi's r304113. llvm-svn: 304114 --- llvm/lib/Demangle/ItaniumDemangle.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/Demangle/ItaniumDemangle.cpp b/llvm/lib/Demangle/ItaniumDemangle.cpp index 03d11a7..34f4017 100644 --- a/llvm/lib/Demangle/ItaniumDemangle.cpp +++ b/llvm/lib/Demangle/ItaniumDemangle.cpp @@ -2525,6 +2525,9 @@ static std::string base_name(std::string &s) { ++p0; break; } + if (!isalpha(*p0) && !isdigit(*p0) && *p0 != '_') { + return std::string(); + } } return std::string(p0, pe); } -- 2.7.4