[libcxxabi] r187255 - I had a buffer mismanagement bug in the demangler.
Howard Hinnant
hhinnant at apple.com
Fri Jul 26 15:14:53 PDT 2013
Author: hhinnant
Date: Fri Jul 26 17:14:53 2013
New Revision: 187255
URL: http://llvm.org/viewvc/llvm-project?rev=187255&view=rev
Log:
I had a buffer mismanagement bug in the demangler.
Modified:
libcxxabi/trunk/src/cxa_demangle.cpp
Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=187255&r1=187254&r2=187255&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Fri Jul 26 17:14:53 2013
@@ -4604,7 +4604,7 @@ __cxa_demangle(const char* mangled_name,
*status = invalid_args;
return nullptr;
}
- size_t internal_size = n != nullptr ? *n : 0;
+ size_t internal_size = buf != nullptr ? *n : 0;
arena<bs> a;
struct Db
{
@@ -4663,7 +4663,11 @@ __cxa_demangle(const char* mangled_name,
buf = nullptr;
}
else
+ {
buf = newbuf;
+ if (n != nullptr)
+ *n = sz;
+ }
}
if (buf != nullptr)
{
More information about the cfe-commits
mailing list