2
0
Эх сурвалжийг харах

Avoid crashing when accessing the tag_time of a headerless tag.

Return None instead.
Lionel Flandrin 8 жил өмнө
parent
commit
92f29426d9
1 өөрчлөгдсөн 6 нэмэгдсэн , 0 устгасан
  1. 6 0
      dulwich/objects.py

+ 6 - 0
dulwich/objects.py

@@ -655,6 +655,9 @@ class Tag(ShaFile):
 
     def __init__(self):
         super(Tag, self).__init__()
+        self._tagger = None
+        self._tag_time = None
+        self._tag_timezone = None
         self._tag_timezone_neg_utc = False
 
     @classmethod
@@ -714,6 +717,9 @@ class Tag(ShaFile):
     def _deserialize(self, chunks):
         """Grab the metadata attached to the tag"""
         self._tagger = None
+        self._tag_time = None
+        self._tag_timezone = None
+        self._tag_timezone_neg_utc = False
         for field, value in _parse_message(chunks):
             if field == _OBJECT_HEADER:
                 self._object_sha = value