[llvm-bugs] [Bug 31030] New: leak in __cxa_demangle
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Nov 15 20:33:46 PST 2016
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: unassignedbugs at nondot.org
Reporter: kcc at google.com
CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161116/b8618566/attachment-0001.html>
More information about the llvm-bugs
mailing list