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/tools/txtar: Parse can panic with slice bounds out of range #47193
Comments
Reproduced. The file name in this example is empty. |
Hello ,Can I submit a CVE for this issues? |
@cor0ps This doesn't appear to be a security vulnerability so I don't think there's any sense in opening a CVE. If you think an issue is a security vulnerability, please report it to security@golang.org instead of the public issue tracker. |
Change https://golang.org/cl/335270 mentions this issue: |
Change https://golang.org/cl/336932 mentions this issue: |
In case the file separator line does not define a filename, it should be ignored. Updates golang/go#47193 Change-Id: I3a0fee584c0f6b2b41814e79d20884d6468a3b76 Reviewed-on: https://go-review.googlesource.com/c/tools/+/336932 Run-TryBot: Jay Conrod <jayconrod@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> Trust: Jay Conrod <jayconrod@google.com> Trust: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
Change https://golang.org/cl/337352 mentions this issue: |
golang.org/x/tools/txtar is the main location for this package. We don't need our own copy. Also, update cmd/vet tests for compatibility with CL 301949. For #47193 Change-Id: I480eb591f57a0d05b433a657653e2021e39354eb Reviewed-on: https://go-review.googlesource.com/c/go/+/337352 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Change https://golang.org/cl/341937 mentions this issue: |
golang.org/x/tools/txtar is the main location for this package. We don't need our own copy. For #47193 Change-Id: I480eb591f57a0d05b433a657653e2021e39354eb Reviewed-on: https://go-review.googlesource.com/c/go/+/337352 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/341937
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes,this is because golang.org/x/tools/txtar, all version maybe reproduce.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/b-471BZeL9y
What did you expect to see?
program run ok
What did you see instead?
panic: runtime error: slice bounds out of range [3:2]
because reason is: strings.TrimSpace(string(data[len(marker) : len(data)-len(markerEnd)]))
len(marker)==3
len(data)-len(markerEnd)==2
maybe this have fix bugs match marker and markerEnd shoud not duplicate!!!
The text was updated successfully, but these errors were encountered: