diff options
author | Björn Gustavsson <[email protected]> | 2014-10-20 12:06:00 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-10-20 12:06:00 +0200 |
commit | 4a2fd35c20ec602a1dc8b28c0fe1906ac35a2b55 (patch) | |
tree | 3dd60d5e46c407f342812dbd5b85877be8429f59 /lib/asn1/c_src/asn1_erl_nif.c | |
parent | 66d3eb4d6757e49c5cf1ddb7ca1809208eafe146 (diff) | |
parent | 4f4f0681a030c6aac3b763def0ee2d37421e4f40 (diff) | |
download | otp-4a2fd35c20ec602a1dc8b28c0fe1906ac35a2b55.tar.gz otp-4a2fd35c20ec602a1dc8b28c0fe1906ac35a2b55.tar.bz2 otp-4a2fd35c20ec602a1dc8b28c0fe1906ac35a2b55.zip |
Merge branch 'maint'
* maint:
BER decoding: Don't allow primitives with indefinite lengths
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 53e3aa1678..317a464060 100644 --- a/lib/asn1/c_src/asn1_erl_nif.c +++ b/lib/asn1/c_src/asn1_erl_nif.c @@ -949,7 +949,7 @@ static int ber_decode_value(ErlNifEnv* env, ERL_NIF_TERM *value, unsigned char * } else if (in_buf[*ib_index] == ASN1_INDEFINITE_LENGTH) { (*ib_index)++; curr_head = enif_make_list(env, 0); - if (*ib_index+1 >= in_buf_len) { + if (*ib_index+1 >= in_buf_len || form == ASN1_PRIMITIVE) { return ASN1_INDEF_LEN_ERROR; } while (!(in_buf[*ib_index] == 0 && in_buf[*ib_index + 1] == 0)) { |