mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
* stdlib/setenv.c (__add_to_environ): Revert previous change.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2015-03-15 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
* stdlib/setenv.c (__add_to_environ): Revert previous change.
|
||||||
|
|
||||||
2015-03-14 Andreas Schwab <schwab@linux-m68k.org>
|
2015-03-14 Andreas Schwab <schwab@linux-m68k.org>
|
||||||
|
|
||||||
[BZ #18128]
|
[BZ #18128]
|
||||||
|
@ -114,16 +114,8 @@ __add_to_environ (name, value, combined, replace)
|
|||||||
{
|
{
|
||||||
char **ep;
|
char **ep;
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
||||||
/* Compute lengths before locking, so that the critical section is
|
|
||||||
less of a performance bottleneck. VALLEN is needed only if
|
|
||||||
COMBINED is non-null. Also, testing COMBINED instead of VALUE
|
|
||||||
causes setenv (..., NULL, ...) to dump core now instead of
|
|
||||||
corrupting memory later. */
|
|
||||||
const size_t namelen = strlen (name);
|
const size_t namelen = strlen (name);
|
||||||
size_t vallen;
|
const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
|
||||||
if (combined != NULL)
|
|
||||||
vallen = strlen (value) + 1;
|
|
||||||
|
|
||||||
LOCK;
|
LOCK;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user