This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add strcspn fuzz test
Needs ReviewPublic

Authored by abrachet on Feb 28 2023, 11:42 AM.

Details

Diff Detail

Event Timeline

abrachet created this revision.Feb 28 2023, 11:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2023, 11:42 AM
abrachet requested review of this revision.Feb 28 2023, 11:42 AM
abrachet added a parent revision: D144995: [libc] Fix strcspn.
michaelrj added inline comments.Feb 28 2023, 3:28 PM
libc/fuzzing/string/strcspn_fuzz.cpp
23

afaik it's best practice to use a segment of the data passed to the fuzzer if you need a random number, so that the test is more repeatable. For an example you can see how the base is selected in strtointeger_fuzz.cpp.