https://llvm.org/bugs/show_bug.cgi?id=31030
Bug ID: 31030 Summary: leak in __cxa_demangle Product: new-bugs Version: unspecified Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: k...@google.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified on fresh trunk: feed these 8 bytes into __cxa_demangle to get a memory leak: 00000000: 5f5a 355a 835a 8340 _Z5Z.Z.@ full reproducer: #include <stddef.h> extern "C" char * __cxa_demangle(const char *mangled_name, char *buf, size_t *n, int *status); int main() { unsigned char buf[] = {0x5f, 0x5a, 0x35, 0x5a, 0x83, 0x5a, 0x83, 0x40, 0}; __cxa_demangle((char*)buf, 0, 0, 0); } cc llvm/projects/libcxxabi/src clang++ -std=c++11 -g cxa_demangle.cpp -I../include repro.cc -o repro -fsanitize=address ==20050==ERROR: LeakSanitizer: detected memory leaks Direct leak of 6 byte(s) in 1 object(s) allocated from: #0 0x4c1fce in realloc #1 0x4f0c33 in __cxa_demangle llvm/projects/libcxxabi/src/cxa_demangle.cpp:5023:47 (found by libFuzzer, see also https://bugs.chromium.org/p/chromium/issues/detail?id=606626) -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs