diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-09-28 11:06:29 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-09-28 14:43:44 +0200 |
commit | c8530493a1b6e773a4d2a16d01e7ed69ae160621 (patch) | |
tree | 44d1b0c6f38a4ba73f731050c3b4ac2a0bf27b48 /askama_parser/src/node.rs | |
parent | 2ef2b9db9e7dfdb57e6c8b59db5493864aaacf3a (diff) | |
download | askama-c8530493a1b6e773a4d2a16d01e7ed69ae160621.tar.gz askama-c8530493a1b6e773a4d2a16d01e7ed69ae160621.tar.bz2 askama-c8530493a1b6e773a4d2a16d01e7ed69ae160621.zip |
Limit expression nesting level to avoid stack overflows
Diffstat (limited to 'askama_parser/src/node.rs')
-rw-r--r-- | askama_parser/src/node.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/askama_parser/src/node.rs b/askama_parser/src/node.rs index a1aa7e2..1ed4e40 100644 --- a/askama_parser/src/node.rs +++ b/askama_parser/src/node.rs @@ -15,6 +15,7 @@ use super::{ bool_lit, char_lit, identifier, is_ws, keyword, num_lit, path_or_identifier, skip_till, str_lit, ws, Expr, PathOrIdentifier, State, }; +use crate::expr::Level; #[derive(Debug, PartialEq)] pub enum Node<'a> { @@ -536,7 +537,7 @@ impl<'a> Call<'a> { cut(tuple(( opt(tuple((ws(identifier), ws(tag("::"))))), ws(identifier), - opt(ws(Expr::arguments)), + opt(ws(|nested| Expr::arguments(nested, Level::default()))), opt(Whitespace::parse), ))), )); |