diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2024-01-11 13:55:46 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2024-01-11 16:32:50 +0100 |
commit | 84c2094e871b7ef16ab51c77b4a3568794c75638 (patch) | |
tree | 5e855fc44f8b993aa01fe84530ef6bf6aa251220 /askama_parser | |
parent | 10c38c51f6e5ce3b50133288af4d993dd47ac0d7 (diff) | |
download | askama-84c2094e871b7ef16ab51c77b4a3568794c75638.tar.gz askama-84c2094e871b7ef16ab51c77b4a3568794c75638.tar.bz2 askama-84c2094e871b7ef16ab51c77b4a3568794c75638.zip |
parser: add test for target recursion overflow
Diffstat (limited to '')
-rw-r--r-- | askama_parser/src/tests.rs | 6 | ||||
-rw-r--r-- | askama_parser/tests/target-recursion.txt | bin | 0 -> 4016 bytes |
2 files changed, 6 insertions, 0 deletions
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()); +} diff --git a/askama_parser/tests/target-recursion.txt b/askama_parser/tests/target-recursion.txt Binary files differnew file mode 100644 index 0000000..aad14e4 --- /dev/null +++ b/askama_parser/tests/target-recursion.txt |