summaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-04-08 08:58:38 +0200
committerMartin Fischer <martin@push-f.com>2021-04-08 15:40:48 +0200
commit2ade35bf1030e4eb4ccf7c02ceba04124669743c (patch)
treef6c17f8fbe39be1e79271a0ca08fbfb07c0f2a03 /fuzz
parent4231388b1fd99b7dbda4dd5885d858aa251513d5 (diff)
delete tree_builder, driver and serialize
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/.gitignore4
-rw-r--r--fuzz/Cargo.toml27
-rw-r--r--fuzz/fuzz_targets/fuzz_document_parse.rs35
3 files changed, 0 insertions, 66 deletions
diff --git a/fuzz/.gitignore b/fuzz/.gitignore
deleted file mode 100644
index 572e03b..0000000
--- a/fuzz/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-
-target
-corpus
-artifacts
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
deleted file mode 100644
index b4dcbe1..0000000
--- a/fuzz/Cargo.toml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-[package]
-name = "html5ever-fuzz"
-version = "0.0.0"
-authors = ["David Korczynski <david@adalogics.com>"]
-publish = false
-edition = "2018"
-
-[package.metadata]
-cargo-fuzz = true
-
-[dependencies]
-libfuzzer-sys = "0.3"
-
-[dependencies.html5ever]
-path = ".."
-
-[dependencies.markup5ever_rcdom]
-path = "../../rcdom/"
-
-# Prevent this from interfering with workspaces
-[workspace]
-members = ["."]
-
-[[bin]]
-name = "fuzz_document_parse"
-path = "fuzz_targets/fuzz_document_parse.rs"
diff --git a/fuzz/fuzz_targets/fuzz_document_parse.rs b/fuzz/fuzz_targets/fuzz_document_parse.rs
deleted file mode 100644
index 17840de..0000000
--- a/fuzz/fuzz_targets/fuzz_document_parse.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-#![no_main]
-use libfuzzer_sys::fuzz_target;
-
-use std::io::BufReader;
-use html5ever::driver::ParseOpts;
-use markup5ever_rcdom::{RcDom, SerializableHandle};
-use html5ever::tendril::TendrilSink;
-use html5ever::tree_builder::TreeBuilderOpts;
-use html5ever::{parse_document, serialize};
-
-// Target inspired by the Rust-Fuzz project
-// https://github.com/rust-fuzz/targets
-fuzz_target!(|data: &[u8]| {
- let opts = ParseOpts {
- tree_builder: TreeBuilderOpts {
- drop_doctype: true,
- ..Default::default()
- },
- ..Default::default()
- };
-
- let dom = parse_document(RcDom::default(), opts)
- .from_utf8()
- .read_from(&mut BufReader::new(data));
-
- let dom = if let Ok(dom) = dom {
- dom
- } else {
- return;
- };
-
- let mut out = std::io::sink();
- let document: SerializableHandle = dom.document.into();
- let _ = serialize(&mut out, &document, Default::default());
-});