]> Cypherpunks.ru repositories - pyderasn.git/blobdiff - pyderasn.py
Fix nasty BitString decode bug
[pyderasn.git] / pyderasn.py
index 207920e9bf42163b05f8e9d93cd67efb7b038679..885f816b2097c93589d9cc2e44af0cc2c5ac5961 100755 (executable)
@@ -2014,7 +2014,7 @@ class BitString(Obj):
                 decode_path=decode_path,
                 offset=offset,
             )
-        if byte2int(v[-1:]) & ((1 << pad_size) - 1) != 0:
+        if byte2int(v[l - 1:l]) & ((1 << pad_size) - 1) != 0:
             raise DecodeError(
                 "invalid pad",
                 klass=self.__class__,