[njs] Increased maximum allowed recursion depth in parser and generator.

Dmitry Volyntsev xeioex at nginx.com
Fri Oct 4 16:50:30 UTC 2019


details:   https://hg.nginx.org/njs/rev/5c71fd61dc15
branches:  
changeset: 1172:5c71fd61dc15
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Oct 04 19:46:35 2019 +0300
description:
Increased maximum allowed recursion depth in parser and generator.

diffstat:

 src/njs_generator.c |  2 +-
 src/njs_parser.h    |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 1cd7640472b8 -r 5c71fd61dc15 src/njs_generator.c
--- a/src/njs_generator.c	Fri Oct 04 19:46:12 2019 +0300
+++ b/src/njs_generator.c	Fri Oct 04 19:46:35 2019 +0300
@@ -513,7 +513,7 @@ njs_generator(njs_vm_t *vm, njs_generato
 {
     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;
     }
diff -r 1cd7640472b8 -r 5c71fd61dc15 src/njs_parser.h
--- a/src/njs_parser.h	Fri Oct 04 19:46:12 2019 +0300
+++ b/src/njs_parser.h	Fri Oct 04 19:46:35 2019 +0300
@@ -116,7 +116,7 @@ void njs_parser_node_error(njs_vm_t *vm,
 
 #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;                                           \
         }                                                                     \


More information about the nginx-devel mailing list