From 6211c9d86ed9a9cf546b1f60159aba2b3e22aa6e Mon Sep 17 00:00:00 2001 From: RBRi Date: Mon, 9 Jan 2023 00:10:27 +0100 Subject: [PATCH] add Rhino primary contact (#9371) --- .../src/main/java/ossfuzz/HtmlParserFuzzer.java | 17 ++++------------- projects/rhino/project.yaml | 1 + 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/projects/htmlunit/htmlunit-fuzzer/src/main/java/ossfuzz/HtmlParserFuzzer.java b/projects/htmlunit/htmlunit-fuzzer/src/main/java/ossfuzz/HtmlParserFuzzer.java index 6db8a5f75..ff0d4ce2b 100644 --- a/projects/htmlunit/htmlunit-fuzzer/src/main/java/ossfuzz/HtmlParserFuzzer.java +++ b/projects/htmlunit/htmlunit-fuzzer/src/main/java/ossfuzz/HtmlParserFuzzer.java @@ -32,9 +32,7 @@ public class HtmlParserFuzzer { private FuzzedDataProvider fuzzedDataProvider; public HtmlParserFuzzer(FuzzedDataProvider fuzzedDataProvider) { - this.fuzzedDataProvider = fuzzedDataProvider; - } BrowserVersion getBrowserVersion() { @@ -42,33 +40,26 @@ public class HtmlParserFuzzer { * from src/test/java/com/gargoylesoftware/htmlunit/WebTestCase.java */ return new BrowserVersion.BrowserVersionBuilder(BrowserVersion.BEST_SUPPORTED) - .setApplicationName("FLAG_ALL_BROWSERS") - .build(); + .setApplicationName("FLAG_ALL_BROWSERS") + .build(); } void test() { - try { - WebClient webClient = new WebClient(getBrowserVersion()); - WebResponse webResponse = new StringWebResponse(fuzzedDataProvider.consumeRemainingAsString(), new URL("http://localhost.edu/index.html")); - HtmlPage page = new HtmlPage(webResponse, webClient.getCurrentWindow()); - + try (WebClient webClient = new WebClient(getBrowserVersion())) { /* * net.sourceforge.htmlunit.corejs.javascript.EvaluatorException * seems to be fatal */ webClient.getOptions().setThrowExceptionOnScriptError(false); - webClient.getCurrentWindow().setEnclosedPage(page); - webClient.getPageCreator().getHtmlParser().parse(webResponse, page, false, false); + webClient.loadHtmlCodeIntoCurrentWindow(fuzzedDataProvider.consumeRemainingAsString()); } catch (IllegalArgumentException e) { - } catch (MalformedURLException e) { } catch (IOException e) { } } public static void fuzzerTestOneInput(FuzzedDataProvider fuzzedDataProvider) { - HtmlParserFuzzer testFixture = new HtmlParserFuzzer(fuzzedDataProvider); testFixture.test(); } diff --git a/projects/rhino/project.yaml b/projects/rhino/project.yaml index 359af4f67..b1165dab4 100644 --- a/projects/rhino/project.yaml +++ b/projects/rhino/project.yaml @@ -1,6 +1,7 @@ homepage: "https://github.com/mozilla/rhino" language: jvm main_repo: "https://github.com/mozilla/rhino.git" +primary_contact: "ronaldbrill@googlemail.com" fuzzing_engines: - libfuzzer sanitizers: