summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/env_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/syscall/env_unix.go')
-rw-r--r--src/pkg/syscall/env_unix.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pkg/syscall/env_unix.go b/src/pkg/syscall/env_unix.go
index 8b1868c27..8573d79c7 100644
--- a/src/pkg/syscall/env_unix.go
+++ b/src/pkg/syscall/env_unix.go
@@ -71,6 +71,16 @@ func Setenv(key, value string) error {
if len(key) == 0 {
return EINVAL
}
+ for i := 0; i < len(key); i++ {
+ if key[i] == '=' || key[i] == 0 {
+ return EINVAL
+ }
+ }
+ for i := 0; i < len(value); i++ {
+ if value[i] == 0 {
+ return EINVAL
+ }
+ }
envLock.Lock()
defer envLock.Unlock()