[libc-commits] [PATCH] D143616: [libc] add standalone strtoint/float fuzzers
Siva Chandra via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Feb 9 23:18:11 PST 2023
sivachandra accepted this revision.
sivachandra added inline comments.
This revision is now accepted and ready to land.
================
Comment at: libc/fuzzing/stdlib/strtofloat_fuzz.cpp:21
+// base for the string to integer conversion and the rest of them as a string to
+// be passed to the string to integer conversion.
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
----------------
Is this comment relevant for strto<float> fuzzers?
================
Comment at: libc/fuzzing/stdlib/strtofloat_fuzz.cpp:36
+
+ auto volatile atof_output = __llvm_libc::atof(str_ptr);
+ auto volatile strtof_output = __llvm_libc::strtof(str_ptr, &out_ptr);
----------------
Add a comment here, and in the strto<integer> fuzzer, explaining that the fuzzer only checks that the conversion algorithm did not read past the null-byte that was inserted above. Essentially, I we should explain what exactly is being tested here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143616/new/
https://reviews.llvm.org/D143616
More information about the libc-commits
mailing list