forked from OSchip/llvm-project
[libFuzzer] honor -exact_artifact_path for all intermediate files during crash minimization (https://github.com/google/oss-fuzz/issues/250)
llvm-svn: 298740
This commit is contained in:
parent
ccc075ca20
commit
dba9ded61f
|
@ -317,7 +317,9 @@ int MinimizeCrashInput(const std::vector<std::string> &Args,
|
|||
CurrentFilePath.c_str(), U.size());
|
||||
|
||||
std::string ArtifactPath =
|
||||
Options.ArtifactPrefix + "minimized-from-" + Hash(U);
|
||||
Flags.exact_artifact_path
|
||||
? Flags.exact_artifact_path
|
||||
: Options.ArtifactPrefix + "minimized-from-" + Hash(U);
|
||||
Cmd += " -minimize_crash_internal_step=1 -exact_artifact_path=" +
|
||||
ArtifactPath;
|
||||
Printf("CRASH_MIN: executing: %s\n", Cmd.c_str());
|
||||
|
|
|
@ -6,7 +6,8 @@ CHECK_EXACT: CRASH_MIN: failed to minimize beyond exact_minimized_path (3 bytes)
|
|||
RUN: rm not_minimal_crash minimized-from-* exact_minimized_path
|
||||
|
||||
RUN: echo -n 'abcd*xyz' > not_minimal_crash
|
||||
RUN: LLVMFuzzer-SingleByteInputTest -minimize_crash=1 not_minimal_crash -artifact_prefix=./ZZZ- -exact_artifact_path=exact_minimized_path 2>&1 | FileCheck %s --check-prefix=MIN1
|
||||
MIN1: Test unit written to ./ZZZ-minimized-from-
|
||||
RUN: LLVMFuzzer-SingleByteInputTest -minimize_crash=1 not_minimal_crash -exact_artifact_path=exact_minimized_path 2>&1 | FileCheck %s --check-prefix=MIN1
|
||||
MIN1: Test unit written to exact_minimized_path
|
||||
MIN1: Test unit written to exact_minimized_path
|
||||
MIN1: INFO: The input is small enough, exiting
|
||||
MIN1: CRASH_MIN: failed to minimize beyond exact_minimized_path (1 bytes), exiting
|
||||
|
|
Loading…
Reference in New Issue