[libcxxabi] r184656 - Filter out '`' in mangled strings and reject them as invalid if found.
Howard Hinnant
hhinnant at apple.com
Sat Jun 22 20:36:38 PDT 2013
Author: hhinnant
Date: Sat Jun 22 22:36:38 2013
New Revision: 184656
URL: http://llvm.org/viewvc/llvm-project?rev=184656&view=rev
Log:
Filter out '`' in mangled strings and reject them as invalid if found.
Modified:
libcxxabi/trunk/src/cxa_demangle.cpp
libcxxabi/trunk/test/test_demangle.cpp
Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=184656&r1=184655&r2=184656&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Sat Jun 22 22:36:38 2013
@@ -4382,7 +4382,7 @@ template <class C>
void
demangle(const char* first, const char* last, C& db, int& status)
{
- if (first >= last)
+ if (first >= last || std::find(first, last, '`') != last)
{
status = invalid_mangled_name;
return;
Modified: libcxxabi/trunk/test/test_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_demangle.cpp?rev=184656&r1=184655&r2=184656&view=diff
==============================================================================
--- libcxxabi/trunk/test/test_demangle.cpp (original)
+++ libcxxabi/trunk/test/test_demangle.cpp Sat Jun 22 22:36:38 2013
@@ -29593,6 +29593,7 @@ const char* invalid_cases[] =
"Agentt",
"NSoERj5E=Y1[uM:ga",
"Aon_PmKVPDk7?fg4XP5smMUL6;<WsI_mgbf23cCgsHbT<l8EE\0uVRkNOoXDrgdA4[8IU>Vl<>IL8ayHpiVDDDXTY;^o9;i",
+ "_ZN8Blizza`d6Memory12voidp_returncvPT_IcEEv",
};
const unsigned NI = sizeof(invalid_cases) / sizeof(invalid_cases[0]);
More information about the cfe-commits
mailing list