diff options
author | Fabian Meumertzheim <meumertzheim@code-intelligence.com> | 2021-02-10 15:56:38 +0100 |
---|---|---|
committer | Fabian Meumertzheim <fabian@meumertzhe.im> | 2021-02-12 09:57:26 +0100 |
commit | 5b94b7b5f1fa9f68832d58d037cdb0267de31906 (patch) | |
tree | 89f52f93058d9d72ec79ad730efa38f106d75f43 /driver/fuzz_target_runner.h | |
parent | 0bcfd380fae4e121e3275fe05c9b8101ffca3fff (diff) | |
download | jazzer-api-5b94b7b5f1fa9f68832d58d037cdb0267de31906.tar.gz |
Optionally read fuzz target info from JAR manifest
By reading the fuzz target class and custom hooks from a JAR manifest
entry rather than a command-line argument, fuzz targets can be fully
self-contained.
This commit adds a Java function that looks for a unique
`Jazzer-Fuzz-Target-Class` attribute in all manifests on the classpath
and returns it to the driver if found. If no such entry is found, it
falls back to the `--target_class` commandline parameter.
In a similar way, the agent prepopulates the list of custom hooks to
load with the merged values of `Jazzer-Hook-Classes` attributes in all
manifests.
Diffstat (limited to 'driver/fuzz_target_runner.h')
-rw-r--r-- | driver/fuzz_target_runner.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/driver/fuzz_target_runner.h b/driver/fuzz_target_runner.h index a7716681..194abc32 100644 --- a/driver/fuzz_target_runner.h +++ b/driver/fuzz_target_runner.h @@ -53,6 +53,8 @@ class FuzzTargetRunner : public ExceptionPrinter { jmethodID fuzzer_tear_down_; std::vector<jlong> ignore_tokens_; + std::string DetectFuzzTargetClass() const; + public: // Initializes the java fuzz target by calling `void fuzzerInitialize(...)`. explicit FuzzTargetRunner( |