Skip to content

netcode 1.4.6: payload packets carry the reader's eight bytes of slack - #189

Merged
gafferongames merged 3 commits into
mainfrom
rowan/release-1.4.6
Sep 10, 2026
Merged

netcode 1.4.6: payload packets carry the reader's eight bytes of slack#189
gafferongames merged 3 commits into
mainfrom
rowan/release-1.4.6

Conversation

@gafferongames

Copy link
Copy Markdown
Contributor

A payload packet now carries eight bytes of slack behind the payload it hands to your reader. netcode returns a pointer into a struct allocated at sizeof plus payload_bytes, and serialize's BitReader loads an eight-byte window from the byte at the read position, so a read that starts in the last seven payload bytes used to reach past the allocation; the old one-byte trailing array left four bytes of alignment padding where the reader contract needs eight. The trailing array is eight bytes, a compile-time check pins it so it cannot shrink, and the arithmetic that sizes the packet is unchanged everywhere else. Nothing on the wire changes and no symbol changes; a consumer that reads netcode payloads through serialize, yojimbo included, gets an in-bounds read on every packet by relinking. Servers and clients should take this release.

@gafferongames
gafferongames merged commit 20d1f50 into main Sep 10, 2026
19 checks passed
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