fix read of null

This commit is contained in:
Alex Groce
2018-07-30 22:09:39 -07:00
parent 0943f812a0
commit 6a9dadcf7a

View File

@@ -560,7 +560,7 @@ extern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
test = DeepState_FirstTest();
const char* which_test = getenv("LIBFUZZER_WHICH_TEST");
if (!(strnlen(which_test, 1024) == 0)) {
if (which_test != NULL) {
for (test = DeepState_FirstTest(); test != NULL; test = test->prev) {
if (strncmp(which_test, test->test_name, strnlen(which_test, 1024)) == 0) {
break;