summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fuzz/.gitignore4
-rw-r--r--fuzz/Cargo.toml22
-rw-r--r--fuzz/fuzz_targets/parse.rs9
3 files changed, 35 insertions, 0 deletions
diff --git a/fuzz/.gitignore b/fuzz/.gitignore
new file mode 100644
index 0000000..572e03b
--- /dev/null
+++ b/fuzz/.gitignore
@@ -0,0 +1,4 @@
+
+target
+corpus
+artifacts
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
new file mode 100644
index 0000000..8aa3986
--- /dev/null
+++ b/fuzz/Cargo.toml
@@ -0,0 +1,22 @@
+
+[package]
+name = "kairos-fuzz"
+version = "0.0.1"
+authors = ["Automatically generated"]
+publish = false
+
+[package.metadata]
+cargo-fuzz = true
+
+[dependencies.kairos]
+path = ".."
+[dependencies.libfuzzer-sys]
+git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
+
+# Prevent this from interfering with workspaces
+[workspace]
+members = ["."]
+
+[[bin]]
+name = "parse"
+path = "fuzz_targets/parse.rs"
diff --git a/fuzz/fuzz_targets/parse.rs b/fuzz/fuzz_targets/parse.rs
new file mode 100644
index 0000000..5d6aa8b
--- /dev/null
+++ b/fuzz/fuzz_targets/parse.rs
@@ -0,0 +1,9 @@
+#![no_main]
+#[macro_use] extern crate libfuzzer_sys;
+extern crate kairos;
+
+fuzz_target!(|data: &[u8]| {
+ if let Ok(data) = std::str::from_utf8(data) {
+ let _ = kairos::parser::parse(data);
+ }
+});