-
Notifications
You must be signed in to change notification settings - Fork 7
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
eX0-go/net.go: sendUDPPacketBytes: Investigate/confirm possible misuse of Read method. #8
Comments
I'm not seeing a check that would report this in the latest version of staticcheck or anywhere. @dominikh, do you know/remember what happened to it? Is it still valid, or did you find some evidence otherwise? |
Same as in 2016: you don't need ReadFull because it's UDP, which is message based. You get a message or you don't, you don't get partial messages. You do need to use |
Yes, that's what assumed when I wrote the code, and it seems to work without issues. But it goes through an I might raise an issue about it in the Go issue tracker then. To be clear, I know how UDP packets work. I don't have full confidence on what happens when they go through |
It's not "going through io.Reader", io.Reader isn't some entity sitting between your connection and you, messing with your data. And UDPConn implements net.Conn, not io.Reader. That aside, if it did split up UDP messages, it would be a 100% broken implementation and still not your concern. But really, we've had this discussion a year ago, check your logs :-) |
Is that why this never made it into a production-ready staticcheck check? |
Depends what you mean by "this". Not complaining about the early error check is probably because of UDP though. I don't recall all the details. |
Originally reported/found by @dominikh.
The text was updated successfully, but these errors were encountered: