Skip to content

Do not use &mut [u8] to point to uninitialized string_buffer - #476

Open
goffrie wants to merge 1 commit into
simd-lite:mainfrom
goffrie:uninit
Open

Do not use &mut [u8] to point to uninitialized string_buffer#476
goffrie wants to merge 1 commit into
simd-lite:mainfrom
goffrie:uninit

Conversation

@goffrie

@goffrie goffrie commented Aug 20, 2026

Copy link
Copy Markdown

It's (probably) UB to have &mut [u8] pointing at uninitialized bytes, so use &mut [MaybeUninit<u8>] instead, and use Vec::spare_capacity_mut to access the buffer instead of set_len.

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