1#include <stdint.h>
2#include <stddef.h>
3#include <string.h>
4#include <stdlib.h>
5extern "C" char *
6__cxa_demangle(const char *mangled_name, char *buf, size_t *n, int *status);
7
8extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
9 char *str = new char[size+1];
10 memcpy(dest: str, src: data, n: size);
11 str[size] = 0;
12 free(ptr: __cxa_demangle(mangled_name: str, buf: 0, n: 0, status: 0));
13 delete [] str;
14 return 0;
15}
16

source code of libcxxabi/fuzz/cxa_demangle_fuzzer.cpp