aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorFabian Meumertzheim <fabian@meumertzhe.im>2021-10-15 16:34:06 +0200
committerFabian Meumertzheim <fabian@meumertzhe.im>2021-10-18 22:31:42 +0200
commit24069c388579f54ec9872e61efa44f5e6065f838 (patch)
tree606965512f8c1632f7f7c74d23f92f4d2b98daf9 /examples
parent818a5033a26d45c2ba4114efc9f4bff4b222edc1 (diff)
downloadjazzer-api-24069c388579f54ec9872e61efa44f5e6065f838.tar.gz
BREAKING: Use OS-specific classpath separator to split jvm_args
This allows us to get rid of the libFuzzer patch to quote argv, which breaks Windows and would have to be turned into a conditional patch otherwise. With this change, all argument separators use the same syntax as the java executable on any given platform. Collisions of ':' as an argument separator and a classpath separator should be rare as we have our own argument to pass in the classpath. This commit implements a rudimentary escaping mechanism to handle the cases where this should be an issue: * \<separator> results in a literal <separator> and no split * \\ results in a literal backlash not interpreted as an escape character for a subsequent <separator> This is a breaking change, but we should rather break this now that we haven't committed to a version 1.0 yet. The only breakage I am aware of is easily fixed: https://github.com/google/oss-fuzz/blob/0c1d5231de61b4166281b4d5685aa66e9f4948a8/projects/kryo/build.sh#L48
Diffstat (limited to 'examples')
-rw-r--r--examples/BUILD.bazel6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel
index 060b0b6c..194b4b5e 100644
--- a/examples/BUILD.bazel
+++ b/examples/BUILD.bazel
@@ -97,9 +97,11 @@ java_fuzz_target_test(
],
fuzzer_args = [
"-fork=5",
- "--jvm_args=-Dfoo=foo;-Dbar=bar",
"--additional_jvm_args=-Dbaz=baz",
- ],
+ ] + select({
+ "@platforms//os:windows": ["--jvm_args=-Dfoo=foo;-Dbar=bar"],
+ "//conditions:default": ["--jvm_args=-Dfoo=foo:-Dbar=bar"],
+ }),
target_class = "com.example.JpegImageParserFuzzer",
# The exit codes of the forked libFuzzer processes are not picked up correctly.
target_compatible_with = SKIP_ON_MACOS,