The string to integer and string to float standalone fuzz targets just
ran the functions and didn't do anything with the output. This was
intentional, since they are intended to be used with sanitizers to
detect buffer overflow bugs. Not using the variables was causing compile
warnings, so this patch adds trivial checks to use the variables.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/fuzzing/stdlib/strtofloat_fuzz.cpp | ||
---|---|---|
50 | Maybe adding an inline function will help with readability here: template <typename T> LIBC_INLINE bool is_nan(T x) { return x != x; } |
libc/fuzzing/stdlib/strtofloat_fuzz.cpp | ||
---|---|---|
20 | LIBC_INLINE is to be used only in the src directory. Else, we are creating an unnecessary dependency. | |
53 | If all of this is present to only silence a compiler warning, and if you really want to check isnan, you are better off using the isnan predicate from math.h. |
LIBC_INLINE is to be used only in the src directory. Else, we are creating an unnecessary dependency.