aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/c_src/asn1_erl_nif.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-10-20 11:51:14 +0200
committerBjörn Gustavsson <[email protected]>2014-10-20 11:51:14 +0200
commit4f4f0681a030c6aac3b763def0ee2d37421e4f40 (patch)
treed46855e45c442286e885f76d8ee85ab3b3db870b /lib/asn1/c_src/asn1_erl_nif.c
parent98baee7ecca0ad0794560d455a1bb0e5f9c5cb40 (diff)
parent62bab9a7a2adbe3f1b7960a35d7dab1d7119c639 (diff)
downloadotp-4f4f0681a030c6aac3b763def0ee2d37421e4f40.tar.gz
otp-4f4f0681a030c6aac3b763def0ee2d37421e4f40.tar.bz2
otp-4f4f0681a030c6aac3b763def0ee2d37421e4f40.zip
Merge branch 'bjorn/asn1/primitive-indefinite-length/OTP-12205' into maint
* bjorn/asn1/primitive-indefinite-length/OTP-12205: 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.c2
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)) {