Skip to content

UTCTimeField: do not fail on out of range timestamps - #5247

Open
bacescuandrei wants to merge 1 commit into
secdev:masterfrom
bacescuandrei:fix-utctimefield-out-of-range
Open

bacescuandrei wants to merge 1 commit into
secdev:masterfrom
bacescuandrei:fix-utctimefield-out-of-range

Conversation

@bacescuandrei

@bacescuandrei bacescuandrei commented Oct 23, 2026 •

Copy link
Copy Markdown

Description

UTCTimeField.i2repr() raises OverflowError: date value out of range when the timestamp is outside of the years datetime supports, so show() and sprintf() fail on such packets:

>>> from scapy.layers.ntlm import NTLMv2_CLIENT_CHALLENGE
>>> NTLMv2_CLIENT_CHALLENGE(b"\xff" * 24).show()
OverflowError: date value out of range

With this change, i2repr() returns the number of seconds alone for these values, as it does after the date for other values.

i2repr() raised OverflowError for values that datetime cannot
represent, e.g. a NTLMv2_CLIENT_CHALLENGE TimeStamp of
0xffffffffffffffff, which made show() and sprintf() fail.

AI-Assisted: yes (Claude Code, claude-opus-5-5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant