summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorscf <scf@FreeBSD.org>2009-12-07 00:22:10 +0000
committerscf <scf@FreeBSD.org>2009-12-07 00:22:10 +0000
commitc1fd4ec15e0c7afdbf59a0bfb1253de4977ed9b5 (patch)
tree90368d65ccd7e5b91007abfeb4e2447a69e22ce8 /lib
parentc71533c8cbac572153a2a4715d3cee74df85bb4d (diff)
downloadFreeBSD-src-c1fd4ec15e0c7afdbf59a0bfb1253de4977ed9b5.zip
FreeBSD-src-c1fd4ec15e0c7afdbf59a0bfb1253de4977ed9b5.tar.gz
Revert behavior change to setenv(), unsetenv() and putenv() until a more
thorough security review has been completed.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/getenv.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c
index 4617f45..b7826d7 100644
--- a/lib/libc/stdlib/getenv.c
+++ b/lib/libc/stdlib/getenv.c
@@ -361,7 +361,8 @@ __build_env(void)
} else {
__env_warnx(CorruptEnvValueMsg, envVars[envNdx].name,
strlen(envVars[envNdx].name));
- continue;
+ errno = EFAULT;
+ goto Failure;
}
/*
@@ -376,7 +377,8 @@ __build_env(void)
false) == NULL) {
__env_warnx(CorruptEnvFindMsg, envVars[envNdx].name,
nameLen);
- continue;
+ errno = EFAULT;
+ goto Failure;
}
envVars[activeNdx].active = true;
}
@@ -558,7 +560,8 @@ __merge_environ(void)
if ((equals = strchr(*env, '=')) == NULL) {
__env_warnx(CorruptEnvValueMsg, *env,
strlen(*env));
- continue;
+ errno = EFAULT;
+ return (-1);
}
if (__setenv(*env, equals - *env, equals + 1,
1) == -1)
OpenPOWER on IntegriCloud