aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-12-10 20:55:19 +0100
committerBjörn Gustavsson <[email protected]>2012-12-18 14:46:02 +0100
commita5567554dd98b37c1d0ecbb52fdb4f55a93a1cf8 (patch)
tree4165b4af5f69f7cc9cd33f281a77cc71ca8fc841 /lib
parent2e5a547716b5f550dbaed24dfbdddf087cba1113 (diff)
downloadotp-a5567554dd98b37c1d0ecbb52fdb4f55a93a1cf8.tar.gz
otp-a5567554dd98b37c1d0ecbb52fdb4f55a93a1cf8.tar.bz2
otp-a5567554dd98b37c1d0ecbb52fdb4f55a93a1cf8.zip
asn1rt_uper_bin: Correct incorrect skipping of extensions
Commit 1b622484ea984f3bc424d2a6760e2d961bfcf816 changed the type of the extension bitmap for uper (from a tuple to a bitstring), but did not do the the corresponding change to the run-time module.
Diffstat (limited to 'lib')
-rw-r--r--lib/asn1/src/asn1rt_uper_bin.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/asn1/src/asn1rt_uper_bin.erl b/lib/asn1/src/asn1rt_uper_bin.erl
index 9410c3ef90..fc65d80245 100644
--- a/lib/asn1/src/asn1rt_uper_bin.erl
+++ b/lib/asn1/src/asn1rt_uper_bin.erl
@@ -120,14 +120,15 @@ fixextensions(Pos,ExtPos,Val,Acc) ->
end,
fixextensions(Pos+1,ExtPos,Val,(Acc bsl 1)+Bit).
-skipextensions(Bytes,Nr,ExtensionBitPattern) ->
- case (catch element(Nr,ExtensionBitPattern)) of
- 1 ->
+skipextensions(Bytes,Nr,ExtensionBitstr) when is_bitstring(ExtensionBitstr) ->
+ Prev = Nr - 1,
+ case ExtensionBitstr of
+ <<_:Prev,1:1,_/bitstring>> ->
{_,Bytes2} = decode_open_type(Bytes,[]),
- skipextensions(Bytes2, Nr+1, ExtensionBitPattern);
- 0 ->
- skipextensions(Bytes, Nr+1, ExtensionBitPattern);
- {'EXIT',_} -> % badarg, no more extensions
+ skipextensions(Bytes2, Nr+1, ExtensionBitstr);
+ <<_:Prev,0:1,_/bitstring>> ->
+ skipextensions(Bytes, Nr+1, ExtensionBitstr);
+ _ ->
Bytes
end.