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

Fix panics in ClientSubnet conversions #1909

Merged
merged 4 commits into from Mar 20, 2023
Merged

Fix panics in ClientSubnet conversions #1909

merged 4 commits into from Mar 20, 2023

Conversation

djc
Copy link
Collaborator

@djc djc commented Mar 20, 2023

#1906 (cc @mokeyish) introduced From conversions that called expect(), which caused errors in OSS-Fuzz. Replace these From impls with TryFrom instead, and upgrade to 2021 edition where TryFrom/TryInto became part of the prelude.

@djc djc requested a review from bluejekyll March 20, 2023 14:20
@mokeyish
Copy link
Contributor

I found that too, but I follow Minimal Changes. So continue using From/Into.

@djc
Copy link
Collaborator Author

djc commented Mar 20, 2023

As far as I can tell the From implementations for the other EDNS types were actually infallible, unlike the new type you added. Ideally we would catch this during review, but writing code that is correct/robust to failures is more important than "minimal changes".

Copy link
Member

@bluejekyll bluejekyll left a comment

Choose a reason for hiding this comment

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

Thanks, @djc, I missed the expect calls there.

@bluejekyll bluejekyll merged commit 72f2a07 into main Mar 20, 2023
@bluejekyll bluejekyll deleted the robust-opt branch March 20, 2023 15:49
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.

None yet

3 participants