Skip to content

stream: add optional -fbounds-safety annotation for body_data - #109

Open
LaptopsPlural wants to merge 1 commit into
xiph:mainfrom
LaptopsPlural:local/body-data-fbounds-safety
Open

LaptopsPlural wants to merge 1 commit into
xiph:mainfrom
LaptopsPlural:local/body-data-fbounds-safety

Conversation

@LaptopsPlural

@LaptopsPlural LaptopsPlural commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Secure-by-design memory-safety hardening. Annotates ogg_stream_state.body_data with optional Clang -fbounds-safety / counted-by-style macros. Default builds unchanged (OGG_ENABLE_FBOUNDS_SAFETY OFF).

Contributor: Jeff Bindel via LaptopsPlural (commit uses GitHub noreply due to email-privacy push protection). Not a vulnerability PoC.

Test plan

  • Default build + test_bitwise / test_framing PASS locally
  • Optional bounds-safety ON with supporting Clang (maintainers)

Introduce inert OGG_COUNTED_BY*_ macros and annotate
ogg_stream_state.body_data with OGG_COUNTED_BY_OR_NULL(body_storage).
Keep capacity-then-pointer assignment and pointer-null-then-size-0
clear order so a future -fbounds-safety build can enforce the existing
size relationship. Default builds are unchanged (macros empty;
OGG_ENABLE_FBOUNDS_SAFETY=OFF).
@LaptopsPlural
LaptopsPlural force-pushed the local/body-data-fbounds-safety branch from a33bb74 to 0e41a60 Compare September 12, 2026 03:31
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