Skip to content

buffer: add optional -fbounds-safety annotations for struct zip_buffer - #578

Open
LaptopsPlural wants to merge 2 commits into
nih-at:mainfrom
LaptopsPlural:local/zip-buffer-fbounds-safety
Open

LaptopsPlural wants to merge 2 commits into
nih-at:mainfrom
LaptopsPlural:local/zip-buffer-fbounds-safety

Conversation

@LaptopsPlural

@LaptopsPlural LaptopsPlural commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Secure-by-design memory-safety hardening. Annotates private struct zip_buffer.data with optional Clang -fbounds-safety / sized-by macros tied to size. Default builds unchanged (ENABLE_FBOUNDS_SAFETY OFF).

Contributor: Jeff Bindel via LaptopsPlural. Not a vulnerability PoC.

Test plan

  • Default CMake build / tests
  • Optional bounds-safety ON with supporting Clang (maintainers)

Introduce inert ZIP_SIZED_BY*_ macros (OFF by default) and annotate the
internal zip_buffer data/size pair used on ZIP parse paths. Capacity-first
assign in _zip_buffer_new. Default builds unchanged; ENABLE_FBOUNDS_SAFETY
opt-in for experimental Clang toolchains.

This branch has not been deployed

No deployments
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