aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2014-09-03 00:56:31 +0200
committerDavid du Colombier <0intro@gmail.com>2014-09-03 00:56:31 +0200
commitb3f224b2801059bf6b2d1b4001ffd8d34c91d19e (patch)
tree6fcd3f25b89c4b910b07b44a4fd2cd41e9b09415 /src/pkg/runtime
parent3306d119b07e5b8b51a8ee5502bec859e62a5835 (diff)
downloadgo-b3f224b2801059bf6b2d1b4001ffd8d34c91d19e.tar.xz
runtime: handle empty environment variables on Plan 9
LGTM=bradfitz, rsc R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/137920044
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/env_plan9.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/runtime/env_plan9.go b/src/pkg/runtime/env_plan9.go
index b6dcb4c1ea..76e9867e03 100644
--- a/src/pkg/runtime/env_plan9.go
+++ b/src/pkg/runtime/env_plan9.go
@@ -31,6 +31,10 @@ func gogetenv(key string) string {
return ""
}
n := seek(fd, 0, 2) - 1
+ if n <= 0 {
+ close(fd)
+ return ""
+ }
p := make([]byte, n)