Skip to content

fix(pj_plugins): validate a spliced GridMap right after attaching its bytes (SDK 0.26.1) - #188

Merged
facontidavide merged 2 commits into
mainfrom
fix/gridmap-splice-validate
Sep 3, 2026
Merged

fix(pj_plugins): validate a spliced GridMap right after attaching its bytes (SDK 0.26.1)#188
facontidavide merged 2 commits into
mainfrom
fix/gridmap-splice-validate

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #185 from its review: deserializeGridMap accepts a header-only wire (the functional-v2 splice form) and defers the data-length check to validateGridMap(), but neither host splice-attachment path ran that check after attaching the bytes. A spliced GridMap whose bytes could not cover its declared cells reached consumers unchecked.

Both paths, MessageParserHandle (functional v2 sink) and ParserModuleRuntime (ownObjectOutput), now call validateGridMap() immediately after attachment and reject failures as a contract violation. Docs updated to say the host validates on attach and consumers validate again defensively.

Test plan

  • Tests first: HostV2PathRejectsSplicedGridMapWhoseBytesDoNotCoverTheCells and ParserModuleRuntime.RejectsGridMapSpliceWhoseBytesDoNotCoverTheCells (new fixture claim splice-grid-map-short) failed before the change, pass after
  • Release build + ctest: 84/84
  • ./build.sh --debug && ./test.sh (ASAN): 84/84
  • pre-commit clean

Release

PATCH: VERSION 0.26.1, CHANGELOG entry. Host-side only; no header layout, ABI or wire change.

🤖 Generated with Claude Code

facontidavide and others added 2 commits September 2, 2026 23:34
… bytes (SDK 0.26.1)

deserializeGridMap accepts a header-only wire (the functional-v2 splice form)
and leaves the data-length check to validateGridMap(). Both host splice
attachment paths, the functional parser handle and the parser-module runtime,
now run that check as soon as the bytes are attached, so a spliced GridMap
whose bytes cannot cover its declared cells is rejected as a contract
violation instead of reaching consumers.

Host-side only: no header layout, ABI or wire change. Tests cover both paths
with a two-column grid spliced with a single byte.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@facontidavide
facontidavide merged commit dadb725 into main Sep 3, 2026
7 checks passed
@facontidavide
facontidavide deleted the fix/gridmap-splice-validate branch September 3, 2026 20:53
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