diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-02-14 13:14:18 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-02-14 13:14:47 -0800 |
commit | a828bb24ee96386201c4236ea917677b6c536c7d (patch) | |
tree | 2a64c9ee1b5ad7fb8bf19374bfbabf1f6e2dfa4a /m4 | |
parent | 142eb2ee2f26e522b7ab0d8fefb0b3c34201f208 (diff) | |
download | gnulib-a828bb24ee96386201c4236ea917677b6c536c7d.tar.gz |
putenv: fix heap corruption with mixed putenv/_putenv
Problem reported by Michael Goffioul in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-02/msg00061.html>.
* lib/putenv.c (putenv) [HAVE__PUTENV]:
Rely on _putenv to allocate the new environment.
* m4/putenv.m4 (gl_PREREQ_PUTENV): New macro.
* modules/putenv (configure.ac): Use it.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/putenv.m4 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/m4/putenv.m4 b/m4/putenv.m4 index 9de53527a7..03ed4f97db 100644 --- a/m4/putenv.m4 +++ b/m4/putenv.m4 @@ -48,3 +48,9 @@ AC_DEFUN([gl_FUNC_PUTENV], ;; esac ]) + +# Prerequisites of lib/putenv.c. +AC_DEFUN([gl_PREREQ_PUTENV], +[ + AC_CHECK_FUNCS([_putenv]) +]) |