diff options
author | Ting-Wei Lan <tingwei.lan@cobinhood.com> | 2019-03-04 16:06:14 +0800 |
---|---|---|
committer | Jhih-Ming Huang <jm.huang@cobinhood.com> | 2019-05-06 10:44:04 +0800 |
commit | 126145a7eca2c054367abc65291ab1c90c51b998 (patch) | |
tree | 549ad2d5eb4c70f096d265cc3a7a6a9f1bb3c120 /core/vm/sqlvm/ast | |
parent | efabc336cf705aab463d81dd20e8d95df97e0965 (diff) | |
download | dexon-126145a7eca2c054367abc65291ab1c90c51b998.tar dexon-126145a7eca2c054367abc65291ab1c90c51b998.tar.gz dexon-126145a7eca2c054367abc65291ab1c90c51b998.tar.bz2 dexon-126145a7eca2c054367abc65291ab1c90c51b998.tar.lz dexon-126145a7eca2c054367abc65291ab1c90c51b998.tar.xz dexon-126145a7eca2c054367abc65291ab1c90c51b998.tar.zst dexon-126145a7eca2c054367abc65291ab1c90c51b998.zip |
core: vm: sqlvm: limit the depth of AST to 1024
Since we traverse an AST by calling functions recursively, we have to
protect the parser by limiting the depth of an AST.
Diffstat (limited to 'core/vm/sqlvm/ast')
-rw-r--r-- | core/vm/sqlvm/ast/constants.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/vm/sqlvm/ast/constants.go b/core/vm/sqlvm/ast/constants.go new file mode 100644 index 000000000..a11a182ea --- /dev/null +++ b/core/vm/sqlvm/ast/constants.go @@ -0,0 +1,5 @@ +package ast + +// DepthLimit is the limit of AST depth used to prevent exhausting the stack +// when traversing the tree recursively. +const DepthLimit = 1024 |