mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-16 14:28:34 +00:00
Merge commit from fork
Lower `CJSON_NESTING_LIMIT` from upstream default 1000 to 64 via `SWITCH_AM_CFLAGS` / `SWITCH_AM_CXXFLAGS`. The mutually recursive `parse_value`/`parse_array`/`parse_object` chain in cJSON consumes ~2 stack frames per nesting level, which can overflow worker threads running on `SWITCH_THREAD_STACKSIZE` (240 KB).
This commit is contained in:
1 parent
74d320834b
commit
02ac36bb11
1 file changed
+5
@@ -308,6 +308,11 @@ SWITCH_AM_CXXFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/incl
|
|||||||
SWITCH_AM_CPPFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src"
|
SWITCH_AM_CPPFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src"
|
||||||
SWITCH_AM_LDFLAGS="-lm"
|
SWITCH_AM_LDFLAGS="-lm"
|
||||||
|
|
||||||
|
# Cap cJSON parser recursion depth. Default upstream limit (1000) can overflow
|
||||||
|
# small thread stacks; both vendored cJSON copies (src/ and libs/esl/) honor this.
|
||||||
|
APR_ADDTO(SWITCH_AM_CFLAGS, [-DCJSON_NESTING_LIMIT=64])
|
||||||
|
APR_ADDTO(SWITCH_AM_CXXFLAGS, [-DCJSON_NESTING_LIMIT=64])
|
||||||
|
|
||||||
#set SOLINK variable based on compiler and host
|
#set SOLINK variable based on compiler and host
|
||||||
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
|
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
|
||||||
SOLINK="-Bdynamic -dy -G"
|
SOLINK="-Bdynamic -dy -G"
|
||||||
|
|||||||
Reference in new issue
Block a user