aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Fuzzer/test/SimpleTest.cpp
diff options
context:
space:
mode:
authorMike Aizatsky <aizatsky@chromium.org>2015-12-02 22:43:53 +0000
committerMike Aizatsky <aizatsky@chromium.org>2015-12-02 22:43:53 +0000
commit71552ce64b161cc94c0bdbc69d6e2f72c54cf90e (patch)
tree95d4f824c9c03b38d5fcc40498ee887d1e8ab5b6 /llvm/lib/Fuzzer/test/SimpleTest.cpp
parent1f11b4e3a724ccfd9b8a583a681e5b5364ed4065 (diff)
downloadllvm-71552ce64b161cc94c0bdbc69d6e2f72c54cf90e.zip
llvm-71552ce64b161cc94c0bdbc69d6e2f72c54cf90e.tar.gz
llvm-71552ce64b161cc94c0bdbc69d6e2f72c54cf90e.tar.bz2
Libfuzzer: do not pass null into user function
Differential Revision: http://reviews.llvm.org/D15098 llvm-svn: 254558
Diffstat (limited to 'llvm/lib/Fuzzer/test/SimpleTest.cpp')
-rw-r--r--llvm/lib/Fuzzer/test/SimpleTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/test/SimpleTest.cpp b/llvm/lib/Fuzzer/test/SimpleTest.cpp
index 6811d11..04225a8 100644
--- a/llvm/lib/Fuzzer/test/SimpleTest.cpp
+++ b/llvm/lib/Fuzzer/test/SimpleTest.cpp
@@ -1,4 +1,5 @@
// Simple test for a fuzzer. The fuzzer must find the string "Hi!".
+#include <assert.h>
#include <cstdint>
#include <cstdlib>
#include <cstddef>
@@ -7,6 +8,7 @@
static volatile int Sink;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+ assert(Data);
if (Size > 0 && Data[0] == 'H') {
Sink = 1;
if (Size > 1 && Data[1] == 'i') {