aboutsummaryrefslogtreecommitdiff
path: root/pyasn1/codec
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2017-11-14 12:12:12 +0100
committerIlya Etingof <etingof@gmail.com>2017-11-14 12:12:12 +0100
commit9ec03d3837d3333f0edb2a0f9919dcf82c1f679c (patch)
treef48c891bf061d1107afaeb36b92b03b5a1182e73 /pyasn1/codec
parentb623b4603d149a4565c6d58e4e85fc31ff2bea2c (diff)
downloadpyasn1-9ec03d3837d3333f0edb2a0f9919dcf82c1f679c.tar.gz
fixed Sequence/SequenceOf decoding heuristics
Diffstat (limited to 'pyasn1/codec')
-rw-r--r--pyasn1/codec/ber/decoder.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/pyasn1/codec/ber/decoder.py b/pyasn1/codec/ber/decoder.py
index 588d343..e8c439d 100644
--- a/pyasn1/codec/ber/decoder.py
+++ b/pyasn1/codec/ber/decoder.py
@@ -451,10 +451,9 @@ class UniversalConstructedTypeDecoder(AbstractConstructedDecoder):
# Now we have to guess is it SEQUENCE/SET or SEQUENCE OF/SET OF
# The heuristics is:
- # * 0-1 component -> likely SEQUENCE OF/SET OF
- # * 1+ components of the same type -> likely SEQUENCE OF/SET OF
- # * otherwise -> likely SEQUENCE/SET
- if len(components) > 1 or len(componentTypes) > 1:
+ # * 1+ components of different types -> likely SEQUENCE/SET
+ # * otherwise -> likely SEQUENCE OF/SET OF
+ if len(componentTypes) > 1:
protoComponent = self.protoRecordComponent
else:
protoComponent = self.protoSequenceComponent