Skip to content

Commit 4cd0e7b

Browse files
Fix #453
1 parent 42991e5 commit 4cd0e7b

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
**v0.53.2**
22
* [[TeamMsgExtractor #452](https://github.com/TeamMsgExtractor/msg-extractor/issues/452)] Adjusted code to allow html encoding to be cached to try to speed up `bs4` operations.
3+
* [[TeamMsgExtractor #453](https://github.com/TeamMsgExtractor/msg-extractor/issues/453)] Fixed handler for too large filetimes so that some filetimes being too large doesn't break the handler.
34
* Fixed a bug that would cause an error in task objects due to a lack of `enumerate`.
45
* Fix `TOCEntry` not initializing `DVTargetDevice` correctly.
56
* Add temporary properties for `ContentID` to `SignedAttachment`. AFAIK these can't ever be set, but this prevents errors in some places.

extract_msg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2828

2929
__author__ = 'Destiny Peterson & Matthew Walker'
30-
__date__ = '2025-03-13'
30+
__date__ = '2025-03-14'
3131
__version__ = '0.53.2'
3232

3333
__all__ = [

extract_msg/utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,14 @@ def filetimeToDatetime(rawTime: int) -> datetime.datetime:
295295
# Just make null dates from all of these time stamps.
296296
from .null_date import NullDate
297297
date = NullDate(1970, 1, 1, 1)
298-
date += datetime.timedelta(seconds = filetimeToUtc(rawTime))
298+
try:
299+
date += datetime.timedelta(seconds = filetimeToUtc(rawTime))
300+
except OverflowError:
301+
# Time value is so large we physically can't represent it, so
302+
# let's just modify the date to it's highest possible value and
303+
# call it a day.
304+
m = date.max
305+
date = NullDate(m.year, m.month, m.day, m.hour, m.minute, m.second, m.microsecond)
299306
date.filetime = rawTime
300307

301308
return date

extract_msg_tests/prop_tests.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@
207207
PropertyFlags.MANDATORY,
208208
NULL_DATE
209209
),
210+
(
211+
'Null Time 4',
212+
b'\x40\x00\x1C\x30\x06\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\x7f',
213+
b'\x40\x00\x1C\x30\x06\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\x7f',
214+
FixedLengthProp,
215+
'301C0040',
216+
0x0040,
217+
PropertyFlags.READABLE | PropertyFlags.WRITABLE,
218+
NULL_DATE
219+
),
210220
# Variable Length Props.
211221
(
212222
'Object',

0 commit comments

Comments
 (0)