Skip to content

net/url: panic in QueryEscape #38643

@tomdeering-wf

Description

@tomdeering-wf

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

$ go version
go version go1.13.10 linux/amd64

Does this issue reproduce with the latest release?

Unknown. I wish I knew a reproducible test case to try.

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

Binary built with:

go env Output
$ go env
GO111MODULE="off"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build206971722=/tmp/go-build -gno-record-gcc-switches"

Deployed in Docker container running busybox-1.31.1-r9

What did you do?

Our application code called the url.QueryEscape function with some (unfortunately unknown) input string.

What did you expect to see?

Encoded string returned to application code.

What did you see instead?

Panic runtime error: index out of range [59802754] with length 59802754 with the following stack:

	/usr/local/go/src/runtime/panic.go:679 +0x1b2
net/url.escape(0xc000318300, 0x1519bc0, 0x6, 0x0, 0x5)
	/usr/local/go/src/net/url/url.go:328 +0x42a
net/url.QueryEscape(...)
	/usr/local/go/src/net/url/url.go:273
net/url.Values.Encode(0xc000d30db0, 0x4, 0x6)
	/usr/local/go/src/net/url/url.go:930 +0x507
	... application code

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions