1712192b
wire: bounds-check skip_field for I32/I64/LEN truncation
skip_field advanced pos by a fixed or length-prefixed amount with no check against #buf, so a truncated unknown field was silently consumed: the outer decode loop's `while pos <= len` exited without raising, making the parser accept payloads it should have rejected. Validates that the new position never exceeds #buf+1 for WIRE_I64, WIRE_I32, and both WIRE_LEN fast and slow paths. WIRE_VARINT already errored correctly via decode_varint's per-byte check. Drops 15 entries from test/conformance/known_failures.txt (PrematureEofBeforeUnknownValue.*, PrematureEofInsideUnknownValue.*, PrematureEofInDelimitedDataForUnknownValue.*).
Eugene Blikh <bigbes@gmail.com> — 2026-05-15 21:19:29 UTC
Commit 1712192b2ee7256d0e4ddd85052a16373280a163 —
view raw patch
Parent(s):
50ed9b68
| File | Status | + | − |
|---|---|---|---|
runtime/pb/wire.lua
|
M | +14 | -4 |
test/conformance/known_failures.txt
|
M | -15 |