Skip to content

Commit

Permalink
Check regular expression depth
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-milovidov committed Jul 22, 2023
1 parent cda42e6 commit 21ffce0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Common/OptimizedRegularExpression.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <limits>
#include <Common/Exception.h>
#include <Common/PODArray.h>
#include <Common/checkStackSize.h>
#include <Common/OptimizedRegularExpression.h>

#define MIN_LENGTH_FOR_STRSTR 3
Expand Down Expand Up @@ -50,6 +51,8 @@ const char * analyzeImpl(
bool & is_trivial,
Literals & global_alternatives)
{
checkStackSize();

/** The expression is trivial if all the metacharacters in it are escaped.
* The non-alternative string is
* a string outside parentheses,
Expand Down

0 comments on commit 21ffce0

Please sign in to comment.