Repository navigation
fix(corekit): read a counted list's cut item as a short read, not a negative length (#2749) - #2755
Merged
Merged
Conversation
…egative length (#2749) - A standalone IGMPv3 Report cut inside a group record read TRUNCATED with its short-read record, and also warned `SchemaWarning: packet length < 0` for each field of the record past the cut. Report.records counts its records and runs to the end of the data, and each record is sized by the octets left to it, so Schema.unpack read the cut record's fields as overrunning a given length. - ListField now reads a schema item it counts with `__data_end__` in its packet; Schema.unpack clears the key as it starts and warns no negative length for a schema whose length ends with the data. Uncounted lists, items past the count and cut headers warn as before; inside a frame the count is unset, so frames parsed through IPv4 are unchanged. - Tests: the Report cut inside each record's fixed fields, source list and aux data, with a malformed record behind IPv4 still warning; a sweep over every list of schema items in the schema registry, with malformed-length controls. Closes #2749
Owner
Author
|
GOOD TO GO at
|
Contributor
|
Coverage: 94.45% (unit tier, Python 3.15,
Per-file detail: the |
This was referenced Nov 4, 2026
JarryShaw
added a commit
that referenced
this pull request
Nov 4, 2026
- Fixed: a cut header's rebuild keeps the next layer its parse had, where 1.5.x rebuilt a cut Ethernet header's Raw as NoPayload, and that Raw carries no error (#2759), a new entry; old values measured against v1.5.1. - Amended unreleased entries (#2758): a cut list of schema items ends with the data, the item the cut lands inside zero-filled and none past it, in the ListField, IGMP and HTTP/2 SETTINGS entries, the last also rebuilding at its declared Length or a recomputed one once edited. - Folded (#2755): a counted item the data ends inside reads as a quiet short read, into the ListField and IGMP entries. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
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)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
A standalone IGMPv3 Report cut inside a group record logged
SchemaWarning: packet length < 0once per field past the cut. It already read TRUNCATED, with the right short-read record and a byte-exact rebuild; only the warning was wrong.ListFieldmarks each schema item it counts with a__data_end__key.Schema.unpackskips the negative-length warning for an item that carries it, so a cut counted item reads quietly.Closes #2749