[libc-commits] [PATCH] D74091: [libc] Lay out framework for fuzzing libc functions.

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Feb 13 14:06:14 PST 2020


abrachet added inline comments.


================
Comment at: libc/fuzzing/string/strcpy_fuzz.cpp:13
+  char *src = (char *)malloc(size + 1);
+  memcpy(src, data, size);
+  for (size_t i = 0; i < size; i++) {
----------------
PaulkaToast wrote:
> MaskRay wrote:
> > Placing malloc in the function LLVMFuzzerTestOneInput may make tests run slowly.
> The test case is rather simple so it runs sufficiently fast about 150k+ executions per second on one of my machine's cores.
> 
> Since we cannot modify the fuzzer input data the only alternative would be using a static buffer, however that introduces a size constraint and we could miss a bug with bigger strings.
nit: make data `const uint8_t*` then.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74091/new/

https://reviews.llvm.org/D74091





More information about the libc-commits mailing list