Repository navigation
fix(sctp): accept a final parameter or cause short of its padding (#1479) - #1481
Merged
Merged
Conversation
) The span of a chunk's nested parameter or error cause list counts the chunk's trailing padding, which the last chunk of a packet may omit (RFC 9260 Sec. 3.2). The last item then read past the data and parsing raised ProtocolError for INIT, INIT ACK, HEARTBEAT, HEARTBEAT ACK, ABORT and ERROR. - Clamp the span to the octets present by wrapping nested_length in bounded, so the final item reads only the padding there is; the #1477 short-padding record then rebuilds it byte-exactly. New tests/protocols/transport/test_sctp_unpadded_final_param_unit.py.
Owner
Author
|
Verdict: GOOD TO GO at
The Host Name rebuild failure behind #1479's literal repro predates this PR and is tracked in #1482. |
2 of 5 tasks
Contributor
|
Coverage: 89.57% (unit tier, Python 3.14,
Per-file detail: the |
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.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeAdded a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseDescription of your pull request and other information
nested_lengthsizes a chunk's parameter or cause list to include the chunk's trailing padding. When the last chunk omits that padding (RFC 9260 §3.2), the last item read past the data and raisedProtocolError. The six nested lists (INIT, INIT ACK, HEARTBEAT, HEARTBEAT ACK, ABORT, ERROR) now wrap the callback inbounded, so the span stops where the data ends. The #1477 short-padding record already rebuilds the item byte-exactly.ASCONF has no dedicated schema. It parses as an opaque chunk and was not affected.
The issue's INIT repro now parses. Its host name
abcdehas no NUL terminator, so_make_param_hostnamestill refuses to rebuild it. That check is older and fails the same way when the parameter is padded, so it is left for a separate issue. The new tests useabcd\0.Tests: the new
test_sctp_unpadded_final_param_unit.pyfails 36/36 onmainand passes on this branch.test_sctp*.py,test_transport_edge_roundtrip_unit.pyandtests/projectpass.repr(info.to_dict())hashes overexamples/captures(23 files) are unchanged.Closes #1479