You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxxabi/fuzz/cxa_demangle_fuzzer.cpp

16 lines
395 B
C++

#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
extern "C" char *
__cxa_demangle(const char *mangled_name, char *buf, size_t *n, int *status);
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
char *str = new char[size+1];
memcpy(str, data, size);
str[size] = 0;
free(__cxa_demangle(str, 0, 0, 0));
delete [] str;
return 0;
}