[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
Fri Feb 21 15:25:18 PST 2020


abrachet added inline comments.


================
Comment at: libc/fuzzing/string/strcpy_fuzz.cpp:1
+#include "src/string/strcpy.h"
+#include <stdint.h>
----------------
We would probably want a header comment here? Also please run `clang-format`


================
Comment at: libc/fuzzing/string/strcpy_fuzz.cpp:5
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+  // validate input
+  if (!size) return 0;
----------------
validate input -> Validate input. The same for the rest of the comments


================
Comment at: libc/fuzzing/string/strcpy_fuzz.cpp:16
+  size_t i;
+  for (i = 0; src[i] != '\0'; i++){
+    // ensure correctness of strcpy
----------------
Couldn't this just be from i = 0 to size?


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