update json-smart-v2 build.sh and maintainer info (#9977)

- Add primary_contact.
- Update the build script to perform a full build with local
dependencies.
- Format JSONParserFuzzer.java
This commit is contained in:
Uriel Chemouni 2023-03-23 16:27:20 +02:00 committed by GitHub
parent a94071d026
commit 20902d5b40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

View File

@ -23,10 +23,9 @@ public class JSONParserFuzzer {
public static void fuzzerTestOneInput(FuzzedDataProvider data) {
String input = data.consumeRemainingAsString();
JSONParser jp = new JSONParser(JSONParser.MODE_PERMISSIVE);
try{
try {
jp.parse(input);
}
catch( ParseException | NumberFormatException e){
} catch (ParseException | NumberFormatException e) {
return;
}
}

View File

@ -17,13 +17,22 @@
mv $SRC/{*.zip,*.dict} $OUT
MAVEN_ARGS="-DskipTests -Djavac.src.version=15 -Djavac.target.version=15 \
-Dmaven.javadoc.skip=true -Dmaven.repo.local=$WORK/m2"
# first install accessors-smart in local $WORK/m2. json-smart depends on it
cd accessors-smart
$MVN install $MAVEN_ARGS
cd ..
# build the actual json-smart
cd json-smart
MAVEN_ARGS="-DskipTests -Djavac.src.version=15 -Djavac.target.version=15 -Dmaven.javadoc.skip=true -Dmaven.repo.local=$WORK/m2"
$MVN package org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade $MAVEN_ARGS
CURRENT_VERSION=$($MVN org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
-Dexpression=project.version -q -DforceStdout)
cp "target/json-smart-$CURRENT_VERSION.jar" $OUT/json-smart.jar
# do not include accessors-smart.jar in ALL_JARS as it is already included with
# maven-shade-plugin:3.2.4:shade
ALL_JARS="json-smart.jar"
# The classpath at build-time includes the project jars in $OUT as well as the
@ -38,7 +47,6 @@ for fuzzer in $(find $SRC -name '*Fuzzer.java'); do
javac -cp $BUILD_CLASSPATH $fuzzer
cp $SRC/$fuzzer_basename.class $OUT/
# Create an execution wrapper that executes Jazzer with the correct arguments.
echo "#!/bin/bash
# LLVMFuzzerTestOneInput for fuzzer detection.

View File

@ -1,6 +1,6 @@
homepage: "https://github.com/netplex/json-smart-v2"
language: jvm
primary_contact: ""
primary_contact: "uchemouni@gmail.com"
fuzzing_engines:
- "libfuzzer"
sanitizers: