Commit 4e537c7
committed
contract: checked_add overflow guard in verify_layout + MD040 fix
Two CodeRabbit fixes for PR #477:
1. soa_envelope.rs — checked_add overflow guard (Major finding)
verify_layout() now computes every column's byte-range end via
checked_add rather than raw usize addition. On 32-bit targets
(wasm32), row_offset (u32 ≤ 4.29e9) + col_bytes can exceed
usize::MAX and wrap to a small value that would silently pass
the `a_end > stride` check. The new closure returns
ColumnOutOfBounds on overflow, covering both positional
overflow and wasm32-wrap in one code path.
2. soa-three-tier-model.md — add `text` language tag (MD040)
The layout table code fence was untagged. Added `text` to
satisfy the no-language-specified lint.
The CodeRabbit "critical" finding about MailboxSoaSnapshot
violating zero-dep is NOT fixed here — that finding is
architecturally incorrect. ndarray IS a declared dependency per
workspace policy; the plan is correct as-is.
https://claude.ai/code/session_0147hSzjmWZDuy2MSQNrhEK51 parent 2af4654 commit 4e537c7
2 files changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
197 | 211 | | |
198 | | - | |
| 212 | + | |
| 213 | + | |
199 | 214 | | |
200 | 215 | | |
201 | 216 | | |
| |||
205 | 220 | | |
206 | 221 | | |
207 | 222 | | |
208 | | - | |
| 223 | + | |
| 224 | + | |
209 | 225 | | |
210 | 226 | | |
211 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
0 commit comments