We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
$ go version go version go1.17.8 linux/amd64
Yes
go env
$ go env GO111MODULE="auto" GOARCH="amd64" GOBIN="/home/zjx/workspace/gowork/bin" GOCACHE="/home/zjx/.cache/go-build" GOENV="/home/zjx/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/zjx/workspace/gowork/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/zjx/workspace/gowork" GOPRIVATE="" GOPROXY="https://goproxy.cn,direct" GOROOT="/home/zjx/.local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/zjx/.local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.17.8" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/zjx/workspace/gowork/src/go-fdg-exmaples/std/go.mod" 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-build1878510231=/tmp/go-build -gno-record-gcc-switches"
I generated an unavailable data to parse as txtar.Archive, and it crashed.
package main import ( "cmd/go/internal/txtar" ) func main() { input := "--\n-- --\n--" txtar.Parse([]byte(input)) }
This code needs to run in GOROOT/src
It parses failed and returns nil
It crashed with
panic: runtime error: slice bounds out of range [3:2] goroutine 1 [running]: cmd/go/internal/txtar.isMarker({0xc000016083, 0x8, 0xd}) /home/zjx/.local/go/src/cmd/go/internal/txtar/archive.go:127 +0x20b cmd/go/internal/txtar.findFileMarker({0xc000016080, 0xb, 0x10}) /home/zjx/.local/go/src/cmd/go/internal/txtar/archive.go:103 +0x86 cmd/go/internal/txtar.Parse({0xc000016080, 0xb, 0x10}) /home/zjx/.local/go/src/cmd/go/internal/txtar/archive.go:81 +0x6c main.main() /home/zjx/.local/go/src/cmd/go/internal/fsys/poc/main.go:9 +0x2c exit status 2
Found by go-fuzz
The text was updated successfully, but these errors were encountered:
The issue should have been fixed by golang/tools@ebce39e. See also #47193.
Sorry, something went wrong.
Closing as dup of #47193. Please comment if you disagree.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I generated an unavailable data to parse as txtar.Archive, and it crashed.
This code needs to run in GOROOT/src
What did you expect to see?
It parses failed and returns nil
What did you see instead?
It crashed with
Found by go-fuzz
The text was updated successfully, but these errors were encountered: