aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/code_intelligence/jazzer/driver/FuzzTargetRunner.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/code_intelligence/jazzer/driver/FuzzTargetRunner.java')
-rw-r--r--src/main/java/com/code_intelligence/jazzer/driver/FuzzTargetRunner.java30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/main/java/com/code_intelligence/jazzer/driver/FuzzTargetRunner.java b/src/main/java/com/code_intelligence/jazzer/driver/FuzzTargetRunner.java
index 3d99dcc5..6967b34f 100644
--- a/src/main/java/com/code_intelligence/jazzer/driver/FuzzTargetRunner.java
+++ b/src/main/java/com/code_intelligence/jazzer/driver/FuzzTargetRunner.java
@@ -99,8 +99,6 @@ public final class FuzzTargetRunner {
private static final int LIBFUZZER_CONTINUE = 0;
private static final int LIBFUZZER_RETURN_FROM_DRIVER = -2;
- private static boolean invalidCorpusFileWarningShown = false;
-
// Keep these options used in runOne (and thus the critical path) in static final fields so that
// they can be constant-folded by the JIT.
private static final Set<Long> ignoredTokens =
@@ -206,18 +204,7 @@ public final class FuzzTargetRunner {
// call to our custom mutator and skip the read entirely.
// 2. Implement a InputStream backed by Unsafe to avoid the copyToArray overhead.
byte[] buf = copyToArray(dataPtr, dataLength);
- boolean readExactly = mutator.read(new ByteArrayInputStream(buf));
-
- // All inputs constructed by the mutator framework can be read exactly, existing corpus files
- // may not be valid for the current fuzz target anymore, though. In this case, print a warning
- // once.
- if (!(invalidCorpusFileWarningShown || readExactly || isFixedLibFuzzerInput(buf))) {
- invalidCorpusFileWarningShown = true;
- Log.warn(
- "Some files in the seed corpus do not match the fuzz target signature. This indicates"
- + " that they were generated with a different signature and may cause issues"
- + " reproducing previous findings.");
- }
+ mutator.read(new ByteArrayInputStream(buf));
data = null;
argument = null;
} else if (useFuzzedDataProvider) {
@@ -361,13 +348,6 @@ public final class FuzzTargetRunner {
return LIBFUZZER_CONTINUE;
}
- private static boolean isFixedLibFuzzerInput(byte[] input) {
- // Detect special libFuzzer inputs which can not be processed by the mutator framework.
- // libFuzzer always uses an empty input, and one with a single line feed (10) to indicate
- // end of initial corpus file processing.
- return input.length == 0 || (input.length == 1 && input[0] == 10);
- }
-
// Called via JNI, being passed data from LLVMFuzzerCustomMutator.
@SuppressWarnings("unused")
private static int mutateOne(long data, int size, int maxSize, int seed) {
@@ -586,14 +566,6 @@ public final class FuzzTargetRunner {
}
/**
- * Returns whether the current mutator has detected invalid corpus files. If no mutator is used,
- * returns false.
- */
- public static boolean invalidCorpusFilesPresent() {
- return mutator != null && invalidCorpusFileWarningShown;
- }
-
- /**
* Disables libFuzzer's fuzz target exit detection until the next call to {@link #runOne}.
*
* <p>Calling {@link System#exit} after having called this method will not trigger libFuzzer's