Repository navigation
fix(blf): reject zero-sized objects instead of looping indefinitely - #2109
Open
timothyanderson096-ocdealcheck wants to merge 2 commits into
Open
timothyanderson096-ocdealcheck wants to merge 2 commits into
timothyanderson096-ocdealcheck wants to merge 2 commits into
Conversation
A zero-sized object leaves the next parser offset unchanged, so iteration can repeatedly process the same record. Raise BLFParseError before reading a payload when an object cannot contain its 16-byte base header. Add regressions for sizes 0, 1 and 15, plus a valid message split across log containers. Include a changelog fragment for issue hardbyte#1584. AI-assisted implementation and verification.
Avoid an unresolved Sphinx class reference in the changelog fragment.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary of Changes
A zero-sized object inside a BLF log container leaves the parser's next position unchanged. Iterating the reader can therefore repeatedly process the same object without finishing.
BLFParseError, before decoding or yielding a message.Related Issues / Pull Requests
Closes #1584. Thanks to @hotbrakepads for the report.
Type of Change
Checklist
tox).Validation
Validated code/tests are in final content tree
60a6f7de724e0620c340338f6c2df4d4e9ab62e7(the final follow-up changes only the changelog's Sphinx markup).python -m pytest test/logformats_test.py::TestBlfFileFormat -q -o addopts='': 16 passed on Python 3.12.14.tox -e lint: passed (Black, Ruff and Pylint project-wide).tox -e type: passed for Python targets 3.10–3.14.tox -e docs: strict HTML build and 39 doctests passed, after correcting the changelog reference.tox -e py312: 507 passed, 98 skipped, 28 failed; 29 subtests passed. Every failure is in the existing IPv4/IPv6 UDP multicast back-to-back classes and reports failure to create/configure the multicast socket. Direct IPv4 and IPv6 multicast probes also fail withOSError: [Errno 101] Network is unreachablein this environment. The full test gate therefore remains unverified; no tests or skips were changed to hide these failures.git diff --check: passed.Python 3.13.16 was used for the configured lint, type and documentation environments. Windows/macOS and physical CAN validation remain for CI/maintainers.
Additional Notes
The implementation change is two lines. It applies to objects inside log containers and leaves the existing handling of supported messages and cross-container data intact. No vehicle or physical CAN adapter was used.
AI assistance: OpenAI Codex prepared the patch and local verification.
Timothy Anderson — Spotted Ridge Engineering / OC Labs
Using GDN — Global Decision Network
timothyanderson096@gmail.com · Engineering evidence