mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/http/pprof: don't treat os.Args as format string in Cmdline handler
Found by @josharian running staticcheck against a fork of this code elsewhere. Change-Id: Ica8bae5df71adde1a71e541dd55b0b81b97b3baf Reviewed-on: https://go-review.googlesource.com/c/go/+/277992 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
6e3cc5c56f
commit
48906a6d57
1 changed files with 1 additions and 1 deletions
|
|
@ -91,7 +91,7 @@ func init() {
|
|||
func Cmdline(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("X-Content-Type-Options", "nosniff")
|
||||
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
||||
fmt.Fprintf(w, strings.Join(os.Args, "\x00"))
|
||||
fmt.Fprint(w, strings.Join(os.Args, "\x00"))
|
||||
}
|
||||
|
||||
func sleep(r *http.Request, d time.Duration) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue