diff options
author | Alexander Monakov <amonakov@ispras.ru> | 2016-03-06 20:22:38 +0300 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2016-03-06 13:33:52 -0500 |
commit | 9543656cc32fda48fc463f332ee20e91eed2b768 (patch) | |
tree | 84f79e285a1aa86c18bcc7015f07568afb3f61c2 | |
parent | 589aefa5b061647e8b9ad9bca3aaa8dc6222460a (diff) | |
download | musl-9543656cc32fda48fc463f332ee20e91eed2b768.tar.gz musl-9543656cc32fda48fc463f332ee20e91eed2b768.tar.bz2 musl-9543656cc32fda48fc463f332ee20e91eed2b768.tar.xz musl-9543656cc32fda48fc463f332ee20e91eed2b768.zip |
env: avoid leaving dangling pointers in __env_map
This is the minimal fix for __putenv leaving a pointer to freed heap
storage in __env_map array, which could later on lead to errors such
as double-free.
-rw-r--r-- | src/env/putenv.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/env/putenv.c b/src/env/putenv.c index 4042869b..71530426 100644 --- a/src/env/putenv.c +++ b/src/env/putenv.c @@ -30,6 +30,7 @@ int __putenv(char *s, int a) } } else { free(__env_map[j]); + __env_map[j] = s; } } } |