aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1rtt_per.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2013-03-13 15:50:57 +0100
committerErlang/OTP <[email protected]>2013-03-13 15:50:57 +0100
commitdf291bae520a2fdd404172fdffaaf040fd939151 (patch)
tree55dc869234e3ba8c27a8cf627395465468941013 /lib/asn1/src/asn1rtt_per.erl
parentcda401b58a3db7213eb14197680d401fd1399de9 (diff)
parent5588449531f1a41d05e5d2d4fe5976db643a18e3 (diff)
downloadotp-df291bae520a2fdd404172fdffaaf040fd939151.tar.gz
otp-df291bae520a2fdd404172fdffaaf040fd939151.tar.bz2
otp-df291bae520a2fdd404172fdffaaf040fd939151.zip
Merge branch 'bjorn/asn1/per-decode/OTP-10916' into maint-r16
* bjorn/asn1/per-decode/OTP-10916: PER: Ensure that the complete encoding is at least one byte PER/UPER: Correct decoding of ENUMERATEDs with a single value
Diffstat (limited to 'lib/asn1/src/asn1rtt_per.erl')
-rw-r--r--lib/asn1/src/asn1rtt_per.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/asn1/src/asn1rtt_per.erl b/lib/asn1/src/asn1rtt_per.erl
index 84ff809912..aa6cf4da0a 100644
--- a/lib/asn1/src/asn1rtt_per.erl
+++ b/lib/asn1/src/asn1rtt_per.erl
@@ -963,7 +963,10 @@ encode_relative_oid(Val) when is_list(Val) ->
%%
complete(L) ->
- asn1rt_nif:encode_per_complete(L).
+ case asn1rt_nif:encode_per_complete(L) of
+ <<>> -> <<0>>;
+ Bin -> Bin
+ end.
octets_to_complete(Len,Val) when Len < 256 ->
[20,Len,Val];