Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AK: Silence false positive -Wstringop-overflow GCC warning in ByteBuffer #25872

Merged

Conversation

spholz
Copy link
Member

@spholz spholz commented Apr 7, 2025

This fixes the following warning caused by the call to ByteBuffer::overwrite in

ti.overwrite(0, digest.immutable_data(), h_len);
"error: writing 64 bytes into a region of size 48"

It seems like GCC incorrectly thinks that the ByteBuffer is using the inline storage in that case.

This error doesn't appear in CI since it enables UBSan.

This fixes the following warning caused by the call to
`ByteBuffer::overwrite` in https://github.com/SerenityOS/serenity/blob/93ca4bc9d1a4fb9db21c3d26fb93e238476016f6/Userland/Libraries/LibCrypto/Hash/PBKDF2.h#L57:
"error: writing 64 bytes into a region of size 48"

It seems like GCC incorrectly thinks that the ByteBuffer is using the
inline storage in that case.
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Apr 7, 2025
@nico nico merged commit 083a836 into SerenityOS:master Apr 8, 2025
18 of 22 checks passed
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Apr 8, 2025
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.

2 participants