When reaching the hard-coded limit to JSON scope stack size, return ENOMEM

instead of aborting.
This commit is contained in:
kristapsdz committed 2020-03-27 20:19:54 +00:00
1 parent 719decfc86
commit 36e6cdcddf
4 files changed
+10 -3

No files matched your search

+4
View File
@@ -39,6 +39,10 @@ enum kjsontype {
KJSON_STRING
};
/*
* The maximum number of JSON scopes allowed.
* Once this has been reached, new scopes will return KCGI_ENOMEM.
*/
#define KJSON_STACK_MAX 128
struct kjsonscope {
+2 -1
View File
@@ -72,7 +72,8 @@ indicating the error state.
.It Dv KCGI_OK
Success (not an error).
.It Dv KCGI_ENOMEM
Internal memory allocation failure.
Internal memory allocation failure, including reaching the maximum
number of possible JSON scopes.
.It Dv KCGI_HUP
The output connection has been terminated.
For FastCGI connections, the current connection should be released with
+2 -1
View File
@@ -72,7 +72,8 @@ indicating the error state.
.It Dv KCGI_OK
Success (not an error).
.It Dv KCGI_ENOMEM
Internal memory allocation failure.
Internal memory allocation failure, including reaching the maximum
number of possible JSON scopes.
.It Dv KCGI_HUP
The output connection has been terminated.
For FastCGI connections, the current connection should be released with
+2 -1
View File
@@ -73,7 +73,8 @@ indicating the error state.
.It Dv KCGI_OK
Success (not an error).
.It Dv KCGI_ENOMEM
Internal memory allocation failure.
Internal memory allocation failure, including reaching the maximum
number of possible JSON scopes.
.It Dv KCGI_HUP
The output connection has been terminated.
For FastCGI connections, the current connection should be released with