Commit dcca8ca8 authored by Evgeniy Isaev's avatar Evgeniy Isaev Committed by Mouse

Added stack overflow check bypass

parent 5c5d7325
...@@ -128,6 +128,13 @@ asn__format_to_callback( ...@@ -128,6 +128,13 @@ asn__format_to_callback(
* Check stack against overflow, if limit is set. * Check stack against overflow, if limit is set.
*/ */
#define ASN__DEFAULT_STACK_MAX (30000) #define ASN__DEFAULT_STACK_MAX (30000)
#ifdef ASN_DISABLE_STACK_OVERFLOW_CHECK
static int CC_NOTUSED
ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) {
(void)ctx;
return 0;
}
#else
static int CC_NOTUSED static int CC_NOTUSED
ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) { ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) {
if(ctx && ctx->max_stack_size) { if(ctx && ctx->max_stack_size) {
...@@ -145,6 +152,7 @@ ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) { ...@@ -145,6 +152,7 @@ ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) {
} }
return 0; return 0;
} }
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment