[libcxxabi] r293330 - Fix ASAN failure in cxa_demangle
Mehdi Amini via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 27 12:32:16 PST 2017
Author: mehdi_amini
Date: Fri Jan 27 14:32:16 2017
New Revision: 293330
URL: http://llvm.org/viewvc/llvm-project?rev=293330&view=rev
Log:
Fix ASAN failure in cxa_demangle
Found with ASAN + libFuzzer by Kostya Serebryany <kcc at google.com>
Modified:
libcxxabi/trunk/src/cxa_demangle.cpp
libcxxabi/trunk/test/test_demangle.pass.cpp
Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=293330&r1=293329&r2=293330&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Fri Jan 27 14:32:16 2017
@@ -1611,7 +1611,8 @@ parse_function_type(const char* first, c
{
if (t == last)
{
- db.names.pop_back();
+ if (!db.names.empty())
+ db.names.pop_back();
return first;
}
if (*t == 'E')
Modified: libcxxabi/trunk/test/test_demangle.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_demangle.pass.cpp?rev=293330&r1=293329&r2=293330&view=diff
==============================================================================
--- libcxxabi/trunk/test/test_demangle.pass.cpp (original)
+++ libcxxabi/trunk/test/test_demangle.pass.cpp Fri Jan 27 14:32:16 2017
@@ -29662,6 +29662,7 @@ const char* invalid_cases[] =
"\x44\x74\x71\x75\x35\x2A\xDF\x74\x44\x61\x73\x63\x35\x2A\x3B\x41\x72\x4D\x6E\x65\x34\x9F\xC1\x63\x41\x72\x4D\x6E\x77\x38\x9A\x8E\x44\x6F\x64\x6C\x53\xF9\x5F\x70\x74\x70\x69\x45\x33\x44\x76\x35",
"\x44\x74\x70\x74\x71\x75\x32\x43\x41\x38\x65\x6E\x9B\x72\x4D\xC1\x43\x41\x72\x4D\x6E\x77\x38\x9A\x8E\x44\x6F\x64\x6C\x53\xF9\x5F\x70\x74\x70\x69\x45\x38\xD3\x73\x9E\x2A\x37",
"\x46\x44\x74\x70\x74\x71\x75\x32\x43\x41\x72\x4D\x6E\x65\x34\x9F\xC1\x43\x41\x72\x4D\x6E\x77\x38\x9A\x8E\x44\x6F\x64\x6C\x53\xF9\x5F\x70\x74\x70\x69\x45\x34\xD3\x73\x9E\x2A\x37\x72\x33\x8E\x3A\x29\x8E\x44\x35",
+ "_ZcvCiIJEEDvT__FFFFT_vT_v",
};
const unsigned NI = sizeof(invalid_cases) / sizeof(invalid_cases[0]);
More information about the cfe-commits
mailing list