add stack overflow protection for SEQUENCE and SEQUENCE OF

This commit is contained in:
Lev Walkin 2017-10-21 01:16:17 -07:00
parent 3c37385d29
commit 62155df04d
4 changed files with 9 additions and 6 deletions

View File

@ -95,10 +95,11 @@ SEQUENCE_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
asn_struct_ctx_t *ctx; /* Decoder context */
size_t consumed_myself = 0; /* Consumed bytes from ptr. */
(void)opt_codec_ctx;
(void)constraints;
if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
ASN__DECODE_FAILED;
/*
* Create the target structure if it is not present already.
*/

View File

@ -1,4 +1,4 @@
/*-
/*
* Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2003, 2004, 2005 Lev Walkin <vlm@lionet.info>.
/*
* Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/

View File

@ -117,9 +117,11 @@ SET_OF_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
asn_struct_ctx_t *ctx; /* Decoder context */
size_t consumed_myself = 0; /* Consumed bytes from ptr. */
(void)opt_codec_ctx;
(void)constraints;
if(ASN__STACK_OVERFLOW_CHECK(opt_codec_ctx))
ASN__DECODE_FAILED;
/*
* Create the target structure if it is not present already.
*/