From 8b11e0b42d6466726639ac702c073047d9fadedb Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sun, 8 Jan 2017 14:46:54 -0500 Subject: [PATCH] net/http: remove check for null bytes in Dir.Open() The syscall package checks for null bytes now. This was added in https://codereview.appspot.com/6458050 Change-Id: I59a2fed3757a25b85e2668905ff5cf2ec8c3a0d3 Reviewed-on: https://go-review.googlesource.com/34978 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/net/http/fs.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/net/http/fs.go b/src/net/http/fs.go index bf63bb5441..51b6b1d32f 100644 --- a/src/net/http/fs.go +++ b/src/net/http/fs.go @@ -34,8 +34,7 @@ import ( type Dir string func (d Dir) Open(name string) (File, error) { - if filepath.Separator != '/' && strings.ContainsRune(name, filepath.Separator) || - strings.Contains(name, "\x00") { + if filepath.Separator != '/' && strings.ContainsRune(name, filepath.Separator) { return nil, errors.New("http: invalid character in file path") } dir := string(d) -- 2.51.0