Skip to content

netip.ParsePrefix must not silently accept ip4in6 address #53135

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

Closed
gaissmai opened this issue May 29, 2022 · 1 comment
Closed

netip.ParsePrefix must not silently accept ip4in6 address #53135

gaissmai opened this issue May 29, 2022 · 1 comment

Comments

@gaissmai
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.18.2 linux/amd64

Does this issue reproduce with the latest release?

it is the latest stable version

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/gaissmai/.cache/go-build"
GOENV="/home/gaissmai/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/gaissmai/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/gaissmai/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/9760"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/9760/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1324338144=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version go1.18.2 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.18.2
uname -sr: Linux 5.13.0-44-generic
Distributor ID:	Ubuntu
Description:	Ubuntu 21.10
Release:	21.10
Codename:	impish
gdb --version: GNU gdb (Ubuntu 11.1-0ubuntu2) 11.1

What did you do?

https://go.dev/play/p/apYQXnnLnTv

What did you expect to see?

panic, netip.MustParsePrefix() should panic on a 4in6 IP address
or at least not silently try this address as IP6

What did you see instead?

inet.MustParsePrefix() did not panic and silently makes an IPv6 address from the 4in6 address

@gaissmai
Copy link
Author

sorry,there is a typo in my IP address, must more investigate, forget it

@golang golang locked and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants