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

network: make SrcAddrSocketOptionImpl safely handle null addresses #1905

Merged
merged 3 commits into from
Nov 2, 2021

Conversation

goaway
Copy link
Contributor

@goaway goaway commented Nov 1, 2021

Description: Adds defensive handling since returned addresses may be null (especially after filtering: #1901).
Risk Level: Low
Testing: Local & On Device

Signed-off-by: Mike Schore mike.schore@gmail.com

Signed-off-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: Mike Schore <mike.schore@gmail.com>
@goaway goaway requested a review from snowp November 2, 2021 00:24
@goaway
Copy link
Contributor Author

goaway commented Nov 2, 2021

@snowp do you mind taking a look at this one as well?

EXPECT_NE(*socket_.connection_info_provider_->localAddress(), *address);
}

TEST_F(SrcAddrSocketOptionImplTest, TestSetOptionSafeWithNullAddress) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(nullptr test)

Copy link
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

@goaway goaway merged commit e41c2b6 into main Nov 2, 2021
@goaway goaway deleted the ms/nullsafe-src-addr branch November 2, 2021 17:40
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