llvm-project/libc
cgyurgyik b07feef873 [libc] This commit fixes the strcmp fuzzing test. It uses a single input and
splits it into two by using the value of the first byte to determine the
length of the first string. Reviewed-by: PaulkaToast, Differential
Revision: https://reviews.llvm.org/D82427

Summary:
[libc] Since only one input is given, it is necessary to split the string into two containers so that they can be compared for the purposes of this fuzz test. This is done in the following manner:

1. Take the value of the first byte; this is size1. (Credits to @PaulkaToast for this idea).
2. size2 is the value of size - size1.
3. Copy the characters to new containers, data1 and data2 with corresponding sizes.
4. Add a null terminator to the first container, and verify the second container has a null terminator.
5. Verify output of strcmp.

A simpler alternative considered was simply splitting the input data into two, but this means the two strings are always within +- 1 character of each other. This above implementation avoids this.

ninja check-libc was run; no issues.

Reviewers: PaulkaToast, sivachandra

Reviewed By: PaulkaToast

Subscribers: mgorny, tschuett, ecnelises, libc-commits, PaulkaToast

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D82427
2020-06-28 12:50:04 -05:00
..
AOR_v20.02 [libc] Disable AOR ulp tests for sinf, cosf and sincosf. 2020-04-17 09:01:44 -07:00
benchmarks [libc] Migrate the libc benchmark instruction to ninja. 2020-06-18 21:54:30 -07:00
cmake/modules [libc][NFC] Make cpu feature check tolerate non-x86 architectures. 2020-06-10 11:11:04 -07:00
config [libc] Add the remaining long double flavors of nearest integer functions. 2020-06-25 22:45:05 -07:00
docs [libc] NFC: Fix trivial typo in comments, documents, and messages 2020-04-06 16:19:34 +09:00
fuzzing [libc] This commit fixes the strcmp fuzzing test. It uses a single input and 2020-06-28 12:50:04 -05:00
include [libc] Add definitions of double_t and float_t to math.h. 2020-04-30 11:59:11 -07:00
lib [libc] Add implementations of round and roundf. 2020-06-09 23:01:20 -07:00
loader [libc] Skip entrypoints not present in the entrypoints list. 2020-06-09 14:40:28 -07:00
spec [libc] Add the remaining long double flavors of nearest integer functions. 2020-06-25 22:45:05 -07:00
src [libc] Add the remaining long double flavors of nearest integer functions. 2020-06-25 22:45:05 -07:00
test [libc] Add the remaining long double flavors of nearest integer functions. 2020-06-25 22:45:05 -07:00
utils [libc] Add the remaining long double flavors of nearest integer functions. 2020-06-25 22:45:05 -07:00
CMakeLists.txt [libc][benchmarks] Link the memory benchmark exes to functions from LLVM libc. 2020-06-17 11:42:26 -07:00
LICENSE.txt
README.txt

README.txt

LLVM libc
=========

This directory and its subdirectories contain source code for llvm-libc,
a retargetable implementation of the C standard library.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.