]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[fuzzer] Make the regression_driver work while fuzzers are active
authorNick Terrell <terrelln@fb.com>
Wed, 10 Apr 2019 01:01:49 +0000 (18:01 -0700)
committerNick Terrell <terrelln@fb.com>
Wed, 10 Apr 2019 01:01:49 +0000 (18:01 -0700)
tests/fuzz/regression_driver.c

index 1553d436ce038edbb6abd5c1514db2a075e38da8..658c685f4f8938bd508ff69c4d33b85a72867cb4 100644 (file)
@@ -40,8 +40,13 @@ int main(int argc, char const **argv) {
     size_t readSize;
     FILE *file;
 
-    /* Check that it is a regular file, and that the fileSize is valid */
-    FUZZ_ASSERT_MSG(UTIL_isRegularFile(fileName), fileName);
+    /* Check that it is a regular file, and that the fileSize is valid.
+     * If it is not a regular file, then it may have been deleted since we
+     * constructed the list, so just skip it.
+     */
+    if (!UTIL_isRegularFile(fileName)) {
+      continue;
+    }
     FUZZ_ASSERT_MSG(fileSize <= kMaxFileSize, fileName);
     /* Ensure we have a large enough buffer allocated */
     if (fileSize > bufferSize) {