aboutsummaryrefslogtreecommitdiff
path: root/agent/src/main/java/com
diff options
context:
space:
mode:
authorNorbert Schneider <norbert.schneider@code-intelligence.com>2022-05-05 09:12:07 +0200
committerNorbert Schneider <mail@bertschneider.de>2022-05-05 20:02:18 +0200
commitd4967bbcb997a02ecfc7b0634caaa4c85b0399cc (patch)
tree49d913cfbd50f369dc94f21de388faa5cc00d3e1 /agent/src/main/java/com
parent3b473ad5b2a142150e3a9182b5670b160261f2c8 (diff)
downloadjazzer-api-d4967bbcb997a02ecfc7b0634caaa4c85b0399cc.tar.gz
Move honeypot class to API
The honeypot class jaz.Zer is needed to successfully execute reproducers of deserialization issues. It's moved to the API artifact to be available on the classpath. Furthermore, reproducers not necessarily reproduce the found issue, e.g. due to global state that leads to different behavior. To take that into account the reproducer check is relaxed.
Diffstat (limited to 'agent/src/main/java/com')
-rw-r--r--agent/src/main/java/com/code_intelligence/jazzer/api/BUILD.bazel1
-rw-r--r--agent/src/main/java/com/code_intelligence/jazzer/api/Jazzer.java7
2 files changed, 4 insertions, 4 deletions
diff --git a/agent/src/main/java/com/code_intelligence/jazzer/api/BUILD.bazel b/agent/src/main/java/com/code_intelligence/jazzer/api/BUILD.bazel
index e573e757..b26bb846 100644
--- a/agent/src/main/java/com/code_intelligence/jazzer/api/BUILD.bazel
+++ b/agent/src/main/java/com/code_intelligence/jazzer/api/BUILD.bazel
@@ -23,6 +23,7 @@ java_library(
"Jazzer.java",
"MethodHook.java",
"MethodHooks.java",
+ "//agent/src/main/java/jaz",
],
visibility = ["//visibility:public"],
)
diff --git a/agent/src/main/java/com/code_intelligence/jazzer/api/Jazzer.java b/agent/src/main/java/com/code_intelligence/jazzer/api/Jazzer.java
index 8f9024fc..2d2e82b0 100644
--- a/agent/src/main/java/com/code_intelligence/jazzer/api/Jazzer.java
+++ b/agent/src/main/java/com/code_intelligence/jazzer/api/Jazzer.java
@@ -593,10 +593,9 @@ final public class Jazzer {
try {
JAZZER_INTERNAL.getMethod("reportFindingFromHook", Throwable.class).invoke(null, finding);
} catch (NullPointerException | IllegalAccessException | NoSuchMethodException e) {
- // We can only reach this point if the runtime is not in the classpath, but it must be if
- // hooks work and this function should only be called from them.
- System.err.println("ERROR: Jazzer.reportFindingFromHook must be called from a method hook");
- System.exit(1);
+ // We can only reach this point if the runtime is not on the classpath, e.g. in case of a
+ // reproducer. Just throw the finding.
+ rethrowUnchecked(finding);
} catch (InvocationTargetException e) {
// reportFindingFromHook throws a HardToCatchThrowable, which will bubble up wrapped in an
// InvocationTargetException that should not be stopped here.