Skip to content

harden: malformed-input hardening, non-panicking encoders, unit coverage - #443

Open
MattJackson wants to merge 2 commits into
stack/s4from
stack/s5
Open

harden: malformed-input hardening, non-panicking encoders, unit coverage#443
MattJackson wants to merge 2 commits into
stack/s4from
stack/s5

Conversation

@MattJackson

@MattJackson MattJackson commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Robustness hardening and broad unit-test coverage across the codec/token layer.

  • Bounds/robustness hardening across codec and token decoders against malformed server input.
  • Non-panicking var-len encoders; DONE-status leniency.
  • AAD-token redaction/zeroize; numeric rescale to column scale instead of panicking.
  • Broad in-crate unit-test coverage across decoders, time, tokens, config.

Squashed into a single commit (all the submitter's own work — no external authorship to preserve here).

Supersedes: none.

Sequential series — merge after #432#435. Based on main; diff reduces to its own delta as the earlier PRs land.
Reviewer note: rebase-merge or merge-commit, not squash (keeps the series consistent).

@MattJackson MattJackson changed the title stack/s5 harden: malformed-input hardening, non-panicking encoders, unit coverage Sep 2, 2026
@MattJackson

Copy link
Copy Markdown
Contributor Author

📌 Carrying over review feedback from the previous incarnation of this PR (#436), which is being closed in favour of a native stacked-PR chain.

@victorchutw raised a still-open correctness issue on this branch — Numeric::precision() counts a phantom integral digit when the integral part is zero (1 + scale), so a fraction-only scale-38 value reports numeric(39,38), which SQL Server rejects. Full report and a focused fix commit here: #436 (comment)

This is tracked and not yet addressed on this branch — flagging so it isn't lost in the migration. Thanks @victorchutw.

- pre_login: comment claimed unknown tokens are skipped, but they are
  rejected as a protocol error (matching the existing test) — fix the comment
- revert the 1<<0 -> 1 churn and drop the "shift-invariant" comments
- trim mutation-testing narration comments across codec/token modules
- remove "previously…" history comments (fixed_len, token_col_metadata, numeric)
- sql_read_bytes: use std::pin::pin! instead of unsafe Pin::new_unchecked in a test
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