From 8f3140a33fa76be248883539d8ecb51b7a7700e2 Mon Sep 17 00:00:00 2001 From: manunio Date: Mon, 11 Sep 2023 18:21:59 +0530 Subject: fuzz: Add fuzz for askama_parser --- askama_parser/fuzz/fuzz_targets/fuzz_parser.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 askama_parser/fuzz/fuzz_targets/fuzz_parser.rs (limited to 'askama_parser/fuzz/fuzz_targets') 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()) {} + } + } +}); -- cgit