Skip to content

Commit

Permalink
Bugfix - prevent infinite parser recursion in stmts & binary exprs. (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
finnbear authored Sep 12, 2023
1 parent 82e0d85 commit bbc077f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/src/sql/value/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2707,6 +2707,7 @@ impl TryNeg for Value {
pub fn value(i: &str) -> IResult<&str, Value> {
let (i, start) = single(i)?;
if let (i, Some(o)) = opt(operator::binary)(i)? {
let _diving = crate::sql::parser::depth::dive(i)?;
let (i, r) = cut(value)(i)?;
let expr = match r {
Value::Expression(r) => r.augment(start, o),
Expand Down Expand Up @@ -2837,6 +2838,7 @@ pub fn select(i: &str) -> IResult<&str, Value> {

/// Used in CREATE, UPDATE, and DELETE clauses
pub fn what(i: &str) -> IResult<&str, Value> {
let _diving = crate::sql::parser::depth::dive(i)?;
let (i, v) = alt((
into(idiom::multi_without_start),
function_or_const,
Expand Down

0 comments on commit bbc077f

Please sign in to comment.