Crashes with bson error when oops is corrupted (zero bytes size)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python OOPS Date-dir repository |
Fix Released
|
Critical
|
Roman Yepishev |
Bug Description
At the moment if oops is 0 bytes long (either .oops or decompressed from .bz) the reader fails with:
Tests running...
=======
ERROR: oops_datedir_
-------
Traceback (most recent call last):
File "oops_datedir_
self.
File "/home/
self.
File "/home/
mismatch = matcher.
File "/home/
mismatch = self.exception_
File "/home/
mismatch = matcher.
File "/home/
reraise(
File "/home/
result = matchee()
File "/home/
self.
File "oops_datedir_
return serializer_
File "oops_datedir_
report = bson.loads(
File "/home/
return decode_
File "/home/
length = struct.unpack("<i", data[base:base + 4])[0]
error: unpack requires a string argument of length 4
Related branches
- Robert Collins (community): Approve
-
Diff: 28 lines (+10/-0)2 files modifiedoops_datedir_repo/serializer.py (+5/-0)
oops_datedir_repo/tests/test_serializer.py (+5/-0)
Changed in python-oops-datedir-repo: | |
status: | New → Triaged |
importance: | Undecided → Critical |
Changed in python-oops-datedir-repo: | |
assignee: | nobody → Roman Yepishev (rye) |
status: | Triaged → Fix Committed |
Changed in python-oops-datedir-repo: | |
status: | Fix Committed → Fix Released |