-
Notifications
You must be signed in to change notification settings - Fork 714
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
fix: resolve UBSAN violations in the codebase #4722
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* make EXPECT_BYTEARRAY_EQUAL to do memcmp when length input isn't zero * proceed regardless of inputs if length is set to be zero * set results of null arithmetic to null pointer instead of undefine
…ion. * Check for s2n_stuffer_write_bytes. Exit if no byte is written. * Check s2n_stuffer_shift's read_cursor. Don't add read_cursor to blob.data if it is zero. * Simplify EXPECT_BYTEARRAY_EQUAL logic.
jmayclin
reviewed
Aug 22, 2024
* Update the comments in s2n_stuffer_shift.
lrstewart
reviewed
Aug 22, 2024
* Modifying comments to be more precise. * Deleteling some unnecessary white space.
lrstewart
reviewed
Aug 22, 2024
* relocate EXPECT_BYTEARRAY_EQUAL comments to within the function * change variable name to make it more specific
jmayclin
approved these changes
Aug 22, 2024
lrstewart
reviewed
Aug 23, 2024
lrstewart
reviewed
Aug 23, 2024
* remove comments for MACRO * comdense comments for stuffer and test
lrstewart
approved these changes
Aug 23, 2024
Change comment location Co-authored-by: Lindsay Stewart <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolved issues:
Partial for issue #4684.
Description of changes:
s2n_test.h
MACROEXPECT_BYTEARRAY_EQUAL
. Add checks for the inputed lengthl
.l
is set to 0, and performmemcmp
isl
is not set to 0.s2n_stuffer.c
ands2n_test_server_client.c
.Call-outs:
UBSAN build command hasn't been integrated into the CI. Need to fix that problem in order to meet the issue's second requirement.
There are 68 tests that pass
NULL
tos2n_stuffer->blob.data
.Testing:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.