diff options
author | Kenneth Lundin <[email protected]> | 2018-12-04 09:40:41 +0100 |
---|---|---|
committer | Kenneth Lundin <[email protected]> | 2018-12-04 09:40:41 +0100 |
commit | 7c79f91fd5878c31c302015f5fc7fec51e4e7977 (patch) | |
tree | e6ac3daf73ddf3e2acde32b1aedbb311f340b414 /lib/asn1/c_src/asn1_erl_nif.c | |
parent | 721b04340b666d476732dfba31f5c89091085d6e (diff) | |
download | otp-7c79f91fd5878c31c302015f5fc7fec51e4e7977.tar.gz otp-7c79f91fd5878c31c302015f5fc7fec51e4e7977.tar.bz2 otp-7c79f91fd5878c31c302015f5fc7fec51e4e7977.zip |
Handle erroneous length during decode (BER only) without crashing
Diffstat (limited to 'lib/asn1/c_src/asn1_erl_nif.c')
-rw-r--r-- | lib/asn1/c_src/asn1_erl_nif.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asn1/c_src/asn1_erl_nif.c b/lib/asn1/c_src/asn1_erl_nif.c index 797be6d4f8..da43af3405 100644 --- a/lib/asn1/c_src/asn1_erl_nif.c +++ b/lib/asn1/c_src/asn1_erl_nif.c @@ -999,7 +999,7 @@ static int ber_decode_value(ErlNifEnv* env, ERL_NIF_TERM *value, unsigned char * while (*ib_index < end_index) { if ((maybe_ret = ber_decode(env, &term, in_buf, ib_index, - *ib_index + len)) <= ASN1_ERROR + end_index )) <= ASN1_ERROR ) return maybe_ret; curr_head = enif_make_list_cell(env, term, curr_head); |