diff options
Diffstat (limited to 'pyasn1/codec/ber/decoder.py')
-rw-r--r-- | pyasn1/codec/ber/decoder.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pyasn1/codec/ber/decoder.py b/pyasn1/codec/ber/decoder.py index 4a9173c..af9d89e 100644 --- a/pyasn1/codec/ber/decoder.py +++ b/pyasn1/codec/ber/decoder.py @@ -139,10 +139,11 @@ class IntegerPayloadDecoder(AbstractSimplePayloadDecoder): if isinstance(chunk, SubstrateUnderrunError): yield chunk - if not chunk: - yield self._createComponent(asn1Spec, tagSet, 0, **options) + if chunk: + value = from_bytes(chunk, signed=True) - value = from_bytes(chunk, signed=True) + else: + value = 0 yield self._createComponent(asn1Spec, tagSet, value, **options) |