Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dlt/dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,11 @@ def _find_next_header(self):
:rtype: int
"""
with open(self.filename, "rb") as fobj:
last_position = self.file_position # pylint: disable=access-member-before-definition
# Skip past the 4-byte DLT\x01 magic of the known-bad message.
# Starting at file_position would find its own magic at offset 0,
# causing the caller to treat it as unrecoverable and break.
# This only happens if the magic isn't also corrupted.
last_position = self.file_position + 4 # pylint: disable=access-member-before-definition
fobj.seek(last_position)
buf = fobj.read(1024)
while buf:
Expand Down
Loading