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

Check length of buffer #106

Merged
merged 2 commits into from
May 13, 2024
Merged

Check length of buffer #106

merged 2 commits into from
May 13, 2024

Conversation

ccotter
Copy link
Contributor

@ccotter ccotter commented May 13, 2024

Describe your changes
Check the buffer length before reading bytes off the buffer.

Testing performed
I added a unit test that exposes the overflow. It fails in an ASAN build without the fix, and succeeds with the fix.

Additional context
This doesn't cause an ASAN failure when sending the bytes to the running server, since the memory region allocated to hold the wire bytes is much larger than what is actually sent by the client. The bytes read though are uninitialized regardless.

ccotter and others added 2 commits May 13, 2024 13:15
Test plan: Added test that triggers stack-buffer-overflow in
AddressSanitizer.
Co-authored-by: Jessica Winer <jwiner10@bloomberg.net>
@ccotter ccotter changed the title Check length Check length of buffer May 13, 2024
Copy link
Contributor

@willhoy willhoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@willhoy willhoy merged commit 62e6ef2 into bloomberg:main May 13, 2024
3 checks passed
@ccotter ccotter deleted the check-length branch May 13, 2024 18:09
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