Repository navigation
fix(sctp): rebuild a Host Name parameter without a NUL terminator as captured (#1482) - #1483
Merged
Merged
Conversation
…captured (#1482) The reader keeps a Host Name Address parameter's name as captured, but _make_param_hostname rejected any name without a NUL terminator, so from_data(info) raised on a packet that parsed. The terminator check now applies only to a user-supplied ``name`` keyword; a parsed record carries its name through unchanged. Docstrings updated to match. Tests: the #1482 repro, a terminated name, every cut after the INIT chunk of a multi-chunk packet, and a direct make() without a terminator, which still raises.
Owner
Author
|
Verdict: GOOD TO GO at
Non-blocking: the comment on |
Contributor
|
Coverage: 89.57% (unit tier, Python 3.14,
Per-file detail: the |
This was referenced Oct 9, 2026
JarryShaw
added a commit
that referenced
this pull request
Oct 9, 2026
#1483 made a captured Host Name without a NUL rebuild as captured, but the schema field comment still said the name always includes one, and the data comment read as a contradiction. Both now say the name is as captured.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort) — not run locallymake testpasses, and a test case covers the change — new tests cover it; targeted suites only, not the fullmake testWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
The reader keeps a Host Name Address parameter's name as captured.
_make_param_hostnamerejected any name without a NUL terminator, soSCTP.from_data(info)raisedProtocolError: [Param 11] invalid formaton a packet that parsed.The fix follows the existing
if <record> is not None: … else: <validate keyword>maker idiom (e.g.ipv4.py:1522). The terminator check now runs only on a usernamekeyword (pcapkit/protocols/transport/sctp.py:2970-2973), and a parsed record rebuilds as read. A hand-builtmake()without a terminator still raises. Docstrings intransport/sctp.pyanddata/transport/sctp.pyare updated to match.schema/transport/sctp.py(#1481) is untouched.New
tests/protocols/transport/test_sctp_hostname_nul_unit.pycovers the #1482 repro, a terminated name, every cut at offsets 44–66 of the #1481 multi-chunk packet, andmake()withabcdefgh. Through bothinfoandinfo.to_dict(), all rebuild cases fail onorigin/mainand pass here. Results:test_sctp*.py66 passed;test_transport_edge_roundtrip_unit.py6 passed;tests/project419 passed, 1 skipped.repr(info.to_dict())hashes over the 23 files inexamples/capturesare identical toorigin/main.Closes #1482