From 84c2094e871b7ef16ab51c77b4a3568794c75638 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 11 Jan 2024 13:55:46 +0100 Subject: parser: add test for target recursion overflow --- askama_parser/src/tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'askama_parser/src/tests.rs') diff --git a/askama_parser/src/tests.rs b/askama_parser/src/tests.rs index 3a7b452..703dd6a 100644 --- a/askama_parser/src/tests.rs +++ b/askama_parser/src/tests.rs @@ -801,3 +801,9 @@ fn fuzzed_macro_no_end() { let s = "{%macro super%}{%endmacro"; assert!(Ast::from_str(s, &Syntax::default()).is_err()); } + +#[test] +fn fuzzed_target_recursion() { + const TEMPLATE: &str = include_str!("../tests/target-recursion.txt"); + assert!(Ast::from_str(TEMPLATE, &Syntax::default()).is_err()); +} -- cgit