-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
net: call net.ResolveIPAddr with nul char causes a panic in the goroutine on Windows build #31597
Comments
In lookupIP, it seems like it is not good to call Deprecated syscall.StringToUTF16Ptr which causes panic. lookupIP: Line 99 in 68d4b12
syscall.StringToUTF16Ptr: go/src/syscall/syscall_windows.go Lines 65 to 66 in 68d4b12
go/src/syscall/syscall_windows.go Lines 27 to 33 in 68d4b12
|
Change https://golang.org/cl/173362 mentions this issue: |
Change https://golang.org/cl/217729 mentions this issue: |
net.LookupHost("foo\x00bar") may resolve successfully on some networks. Reduce the scope of the test to check only that the call doesn't panic. Also update the test comment to reference the relevant issue. Fixes #37031 Updates #31597 Change-Id: If175deed8121625ef507598c6145e937ccffd89e Reviewed-on: https://go-review.googlesource.com/c/go/+/217729 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
What did you do?
My product's server crashed and reproduced the problem from the panic log.
The reproduction program is below.
https://play.golang.org/p/1FdRbei_83s
The reproduction program does not work on Go Playground. Create a windows build and run it.
What did you expect to see?
I wanted to return an error if an invalid string is passed.
What did you see instead?
Output of Windows build binary (
GOOS=windows go run resolve_ip.go
)Output of Linux build binary (
go run resolve_ip.go
)System details
The text was updated successfully, but these errors were encountered: