diff options
author | Björn Gustavsson <[email protected]> | 2015-12-03 11:53:30 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-12-03 11:53:30 +0100 |
commit | 5a6b1342478196ca1ca8c8de6536ee7c01c454f8 (patch) | |
tree | 1977ee0974d7902056a4365ae393cf580e0b89bf /lib/asn1/src/asn1rtt_ber.erl | |
parent | 8afd734873f136bebfe92eaa0f09299250058d85 (diff) | |
parent | 2124579786928996cfd81e58df4615247af5cd79 (diff) | |
download | otp-5a6b1342478196ca1ca8c8de6536ee7c01c454f8.tar.gz otp-5a6b1342478196ca1ca8c8de6536ee7c01c454f8.tar.bz2 otp-5a6b1342478196ca1ca8c8de6536ee7c01c454f8.zip |
Merge branch 'maint'
* maint:
BER: Fix encoding of empty named BIT STRING
Diffstat (limited to 'lib/asn1/src/asn1rtt_ber.erl')
-rw-r--r-- | lib/asn1/src/asn1rtt_ber.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1rtt_ber.erl b/lib/asn1/src/asn1rtt_ber.erl index 39fa8aaf99..e50b14941c 100644 --- a/lib/asn1/src/asn1rtt_ber.erl +++ b/lib/asn1/src/asn1rtt_ber.erl @@ -739,6 +739,8 @@ encode_named_bit_string([H|_]=Bits, NamedBitList, TagIn) when is_atom(H) -> do_encode_named_bit_string(Bits, NamedBitList, TagIn); encode_named_bit_string([{bit,_}|_]=Bits, NamedBitList, TagIn) -> do_encode_named_bit_string(Bits, NamedBitList, TagIn); +encode_named_bit_string([], _NamedBitList, TagIn) -> + encode_unnamed_bit_string(<<>>, TagIn); encode_named_bit_string(Bits, _NamedBitList, TagIn) when is_bitstring(Bits) -> encode_unnamed_bit_string(Bits, TagIn). @@ -746,6 +748,8 @@ encode_named_bit_string(C, [H|_]=Bits, NamedBitList, TagIn) when is_atom(H) -> do_encode_named_bit_string(C, Bits, NamedBitList, TagIn); encode_named_bit_string(C, [{bit,_}|_]=Bits, NamedBitList, TagIn) -> do_encode_named_bit_string(C, Bits, NamedBitList, TagIn); +encode_named_bit_string(C, [], _NamedBitList, TagIn) -> + encode_unnamed_bit_string(C, <<>>, TagIn); encode_named_bit_string(C, Bits, _NamedBitList, TagIn) when is_bitstring(Bits) -> encode_unnamed_bit_string(C, Bits, TagIn). |