Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Dec 2009 00:22:10 +0000 (UTC)
From:      Sean Farley <scf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200198 - head/lib/libc/stdlib
Message-ID:  <200912070022.nB70MAHb036206@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912070022.nB70MAHb036206>