]> git.kaiwu.me - njs.git/commitdiff
Increased maximum allowed recursion depth in parser and generator.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 4 Oct 2019 16:46:35 +0000 (19:46 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 4 Oct 2019 16:46:35 +0000 (19:46 +0300)
src/njs_generator.c
src/njs_parser.h

index b272bcbfeabca5f7587aa9c24ef417062a78c526..1443957d40f3c94ec8185bd084d0265ccafe3590 100644 (file)
@@ -513,7 +513,7 @@ njs_generator(njs_vm_t *vm, njs_generator_t *generator, njs_parser_node_t *node)
 {
     njs_int_t  ret;
 
-    if (njs_slow_path(generator->count++ > 1024)) {
+    if (njs_slow_path(generator->count++ > 4096)) {
         njs_range_error(vm, "Maximum call stack size exceeded");
         return NJS_ERROR;
     }
index cf4062d7a1518e884b3e0540878aa22ac3786f0c..113e00b7b5546814848b814721d9dc360e9b70f5 100644 (file)
@@ -116,7 +116,7 @@ void njs_parser_node_error(njs_vm_t *vm, njs_parser_node_t *node,
 
 #define njs_parser_enter(vm, parser)                                          \
     do {                                                                      \
-        if (njs_slow_path((parser)->count++ > 1024)) {                        \
+        if (njs_slow_path((parser)->count++ > 4096)) {                        \
             njs_range_error(vm, "Maximum call stack size exceeded");          \
             return NJS_TOKEN_ERROR;                                           \
         }                                                                     \