Copy BitStrings tuple, do not reference it
authorSergey Matveev <stargrave@stargrave.org>
Fri, 6 Oct 2017 15:19:37 +0000 (18:19 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 6 Oct 2017 15:19:37 +0000 (18:19 +0300)
pyderasn.py

index 833e785206f26a4f84ec209a793c8c797fba51cc..d14997bfe24d4569f7732bf238e812263aa92f89 100755 (executable)
@@ -1656,7 +1656,10 @@ class BitString(Obj):
 
     def copy(self):
         obj = self.__class__(_specs=self.specs)
-        obj._value = self._value
+        value = self._value
+        if value is not None:
+            value = (value[0], value[1])
+        obj._value = value
         obj.tag = self.tag
         obj._expl = self._expl
         obj.default = self.default