diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2020-12-14 12:09:17 -0800 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2020-12-14 22:28:10 +0000 |
commit | 48906a6d57fdc3c6fd2b6b9fe4c0e31dc225a058 (patch) | |
tree | be2c236fb06d13d13f1eb1107c3fa34ff3056775 /src/net | |
parent | 6e3cc5c56fa532df1f7690ee4955a1751b1ccbce (diff) | |
download | go-48906a6d57fdc3c6fd2b6b9fe4c0e31dc225a058.tar.gz go-48906a6d57fdc3c6fd2b6b9fe4c0e31dc225a058.zip |
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>
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/http/pprof/pprof.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/pprof/pprof.go b/src/net/http/pprof/pprof.go index 2bfcfb9545..5389a388c1 100644 --- a/src/net/http/pprof/pprof.go +++ b/src/net/http/pprof/pprof.go @@ -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) { |