svn commit: r200198 - head/lib/libc/stdlib

Sean Farley scf at FreeBSD.org
Mon Dec 7 00:22:11 UTC 2009


Author: scf
Date: Mon Dec  7 00:22:10 2009
New Revision: 200198
URL: http://svn.freebsd.org/changeset/base/200198

Log:
  Revert behavior change to setenv(), unsetenv() and putenv() until a more
  thorough security review has been completed.

Modified:
  head/lib/libc/stdlib/getenv.c

Modified: head/lib/libc/stdlib/getenv.c
==============================================================================
--- head/lib/libc/stdlib/getenv.c	Mon Dec  7 00:15:39 2009	(r200197)
+++ head/lib/libc/stdlib/getenv.c	Mon Dec  7 00:22:10 2009	(r200198)
@@ -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)


More information about the svn-src-head mailing list