mirror of
https://github.com/luxfi/api.git
synced 2026-09-24 00:24:53 +00:00
fix/zap-unbounded-make
A decoded uint32 element count fed make([]T,count) before the per-element loop consumed any bytes, so a ~9-byte message with count=0xFFFFFFFF could drive a ~100GB allocation (OOM; the 16MB message cap and handler recover() do not bound it). Add Reader.ReadCount(), which rejects any count exceeding Remaining(), and use it in the 9 collection decoders across vm.go, sender.go, warp.go. Co-authored-by: Hanzo Dev <[email protected]>
Languages
Go
79.5%
Cap'n Proto
12.8%
ZAP
7.7%