-
Notifications
You must be signed in to change notification settings - Fork 222
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
Prevent MsgHdr::with_control with empty buffer causes error in macOS #507
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there valid reasons to send an empty control value? Or is this always programmer error?
To tell about the valid reasons, I am not familiar with low level socket API that much. |
No, I would say not doing anything would be better. We're not going to introduce panics in our API, but hiding errors/problematic code is also not something we want. |
53a293b
to
0dd6435
Compare
0dd6435
to
d4c8d9b
Compare
It was a small glitch but painful to debug. I changed the patch to |
Socket2 doesn't hide anything, you pass it an invalid buffer, it will pass that buffer along to the OS.
The layout of
Socket2 is just wrapper around the OS interfaces, so I don't think this fits in socket2. |
I understand your concern. Is there any plan to implement better Debug for MagHdr in that case? Debug can be platform-specific implementation and it will not affect any actual behavior. Minor platforms still can use current implementation |
A pr for that would be accepted. |
Closing this since I still don't think it's something we want. |
Otherwise panic when
cfg(debug_assertions)
will be another good prevention.