fix(dialog): range-check table_delta indexes before narrowing (0.18.1)#155
Closed
facontidavide wants to merge 1 commit into
Closed
fix(dialog): range-check table_delta indexes before narrowing (0.18.1)#155facontidavide wants to merge 1 commit into
facontidavide wants to merge 1 commit into
Conversation
is_number_integer() accepts the full 64-bit range, but the decoder narrowed with an unchecked get<int>(), so an oversized index (e.g. 2^32) silently wrapped into a valid-looking row instead of rejecting. Indexes are now range-checked against int before narrowing; any out-of-range value rejects the whole delta, matching the documented strict-decode contract. Also documents the host-side whole-delta rejection and seq-gate reset contract in dialog-plugin-guide.md, and removes the version-history comment block that had crept back into conanfile.py (CHANGELOG.md is the only ledger). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Codex review of the batch-table-delta feature (#152) found that
WidgetDataView::tableDelta()validates ops withis_number_integer()but then narrows with an uncheckedget<int>(): an oversized index such as4294967296silently wraps to0and targets a valid-looking row instead of rejecting — corrupting the wrong row on the host.int(viaget<std::int64_t>()) before narrowing; any out-of-range value rejects the whole delta, matching the documented strict-decode contract.TableDeltaOversizedIndexRejectsWholeDeltacoversremove_rows, update row, and update col.dialog-plugin-guide.md: the delta contract paragraph now states the host-side rule explicitly — unresolvable ops reject the delta whole with the seq unconsumed, and a fullrowsresync resets the host's seq gate (paired host change: PJ4 PR).conanfile.py: removed the version-history comment block that crept back in — CHANGELOG.md is the only ledger (per feat(sdk): typed table sort keys in the dialog protocol (0.18.0) #149).Test plan
widget_data_view_test(new + existing decode tests) green.🤖 Generated with Claude Code