]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: remove check for null bytes in Dir.Open()
authorAnmol Sethi <anmol@aubble.com>
Sun, 8 Jan 2017 19:46:54 +0000 (14:46 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 1 Feb 2017 21:12:47 +0000 (21:12 +0000)
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 <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/http/fs.go

index bf63bb5441f31a3187c1d0ddfb1ac19bf1b4550c..51b6b1d32f4e1daf73469639fd8bf2d482acbd26 100644 (file)
@@ -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)