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
x/net/icmp: ListenPacket shouldn't panic for invalid network #32933
Comments
The bug is a missing range check here: i := last(network, ':')
switch network[:i] { |
Yes, I try to fix the |
Change https://golang.org/cl/185317 mentions this issue: |
Since it has been a couple of days, i took a swing at it.
Now instead of a panic an error is returned. |
HI @ivenk, thanks for your PR. I have make a same PR for this bug, but it blocked at code review, you can check it with link https://golang.org/cl/185317 |
Oh okay i didn't know about that. Will get fixed eventually then. |
I write some test for
x/net/icmp
, there is my code:When I run the code, get error message like:
I known the reason is because I use an invalid network, it should be
ip4:1
rather thanip4
. But I think it should raise a specific error rather than a panic runtime error.The text was updated successfully, but these errors were encountered: