This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch fuzzing
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/fuzzing by this push:
     new 755ccb4c43 Fix script folder detection
755ccb4c43 is described below

commit 755ccb4c43869441f1b14d34badd89a3a6fb50e7
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Thu Aug 8 14:04:49 2024 +0200

    Fix script folder detection
---
 oss-fuzz-build.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/oss-fuzz-build.sh b/oss-fuzz-build.sh
index 9dc5273d44..070a7cef05 100755
--- a/oss-fuzz-build.sh
+++ b/oss-fuzz-build.sh
@@ -116,17 +116,19 @@ for module in *-fuzz-test; do
 
 # OSS-Fuzz detects fuzzers by checking the presence of the magical 
"LLVMFuzzerTestOneInput" word, hence this line.
 
+scriptDir=\$(cd -- "\$(dirname -- "\${BASH_SOURCE[0]}")")
+
 # Determine JVM args
-if [[ "\$@" =~ (^| )-runs=[0-9]+($| ) ]]; then
+if [[ "\$@" =~ (^| )-runs=[0-9]+(\$| ) ]]; then
   jvmArgs="-Xmx1900m:-Xss900k"
 else
   jvmArgs="-Xmx2048m:-Xss1024k"
 fi
 
 # Run the fuzzer
-LD_LIBRARY_PATH="$JVM_LD_LIBRARY_PATH" \\
-  /usr/local/bin/jazzer_driver \\
-  --agent_path=/usr/local/bin/jazzer_agent_deploy.jar \\
+LD_LIBRARY_PATH="\$JVM_LD_LIBRARY_PATH":"\$scriptDir" \\
+"\$scriptDir/jazzer_driver" \\
+  --agent_path="\$scriptDir/jazzer_agent_deploy.jar" \\
   --cp="$classPath" \\
   --target_class="$fqcn" \\
   --jvm_args="\$jvmArgs" \\

Reply via email to