Skip to content

Commit

Permalink
fix: decrease the call limit in fuzzer (#690)
Browse files Browse the repository at this point in the history
closes #689

Co-authored-by: Tomas Tauber <me@tomtau.be>
  • Loading branch information
tomtau and Tomas Tauber committed Aug 13, 2022
1 parent b6c482e commit 40e3752
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion meta/fuzz/fuzz_targets/parser.rs
Expand Up @@ -8,7 +8,7 @@ use std::convert::TryInto;

fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
pest::set_call_limit(Some(25_000usize.try_into().unwrap()));
pest::set_call_limit(Some(5_000usize.try_into().unwrap()));
let _ = pest_meta::parser::parse(pest_meta::parser::Rule::grammar_rules, s);
}
});
3 changes: 3 additions & 0 deletions meta/resources/test/fuzzsample5.grammar
@@ -0,0 +1,3 @@
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/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*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*#*/
/*#*/
/* /*:/*
9 changes: 8 additions & 1 deletion meta/src/parser.rs
Expand Up @@ -1522,8 +1522,12 @@ mod tests {
env!("CARGO_MANIFEST_DIR"),
"/resources/test/fuzzsample4.grammar"
));
let sample5 = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/resources/test/fuzzsample5.grammar"
));
const ERROR: &str = "call limit reached";
pest::set_call_limit(Some(25_000usize.try_into().unwrap()));
pest::set_call_limit(Some(5_000usize.try_into().unwrap()));
let s1 = crate::parser::parse(crate::parser::Rule::grammar_rules, sample1);
assert!(s1.is_err());
assert_eq!(s1.unwrap_err().variant.message(), ERROR);
Expand All @@ -1536,5 +1540,8 @@ mod tests {
let s4 = crate::parser::parse(crate::parser::Rule::grammar_rules, sample4);
assert!(s4.is_err());
assert_eq!(s4.unwrap_err().variant.message(), ERROR);
let s5 = crate::parser::parse(crate::parser::Rule::grammar_rules, sample5);
assert!(s5.is_err());
assert_eq!(s5.unwrap_err().variant.message(), ERROR);
}
}

0 comments on commit 40e3752

Please sign in to comment.