* [libesl] Validate `Content-Length` in `esl_recv_event`.
`atol()` accepted negative values, allowing a remote ESL peer to cause
a one-byte heap underwrite (`Content-Length: -1`) or NULL-pointer
dereference (`Content-Length: -2`, since `esl_assert` compiles out
under `NDEBUG`). Reject negative and oversized values, and check
`malloc` failure instead of relying on `assert`.
Cap at `ESL_MAX_CONTENT_LENGTH` (16 MiB).
* [libesl] Add test_recv_event.
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 is a request to change configure.ac target libraries for Apple Silicon computers and a general cleanup/update for macOS.
Different target on Apple Silicon
Apple has stated that other programs should be installed into /opt for Apple Silicon computers instead of /usr/local. Homebrew installs everything in /opt. Multiple changes were made to handle this.
Added code to auto change the default from /usr/local to /opt for Apple Silicon. All other systems default to /usr/local as before.
Where target libraries were different, code was added to only add the correct libraries to the appropriate architecture. This eliminates a lot of warning message for missing libraries.
Compiler flags were updated to conform to current clang. Obsolete code that can no longer work (for old apple ancient releases or compilers) was removed or replaced.