aboutsummaryrefslogtreecommitdiffstats
path: root/askama_parser/fuzz/fuzz_targets/fuzz_parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'askama_parser/fuzz/fuzz_targets/fuzz_parser.rs')
-rw-r--r--askama_parser/fuzz/fuzz_targets/fuzz_parser.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/askama_parser/fuzz/fuzz_targets/fuzz_parser.rs b/askama_parser/fuzz/fuzz_targets/fuzz_parser.rs
new file mode 100644
index 0000000..374936c
--- /dev/null
+++ b/askama_parser/fuzz/fuzz_targets/fuzz_parser.rs
@@ -0,0 +1,13 @@
+#![no_main]
+use askama_parser::*;
+use libfuzzer_sys::fuzz_target;
+use std::str;
+
+fuzz_target!(|data: &[u8]| {
+ // fuzzed code goes here
+ if data.len() < 500 {
+ if let Ok(data) = str::from_utf8(data) {
+ if let Ok(_) = Ast::from_str(data, &Syntax::default()) {}
+ }
+ }
+});