Skip to content

Commit

Permalink
[libFuzzer] ensure that strncmp is not inlined in a test
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299177 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
kcc committed Mar 31, 2017
1 parent 8cefdcb commit 15e73a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Fuzzer/test/SingleStrncmpTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
char *S = (char*)Data;
if (Size >= 6 && !strncmp(S, "qwerty", 6)) {
volatile auto Strncmp = &(strncmp); // Make sure strncmp is not inlined.
if (Size >= 6 && !Strncmp(S, "qwerty", 6)) {
fprintf(stderr, "BINGO\n");
exit(1);
}
Expand Down

0 comments on commit 15e73a6

Please sign in to comment.