diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2017-01-20 00:45:09 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2017-01-20 00:45:09 +0530 |
commit | 41389c40499a083c59e68ba281ec87be567f2871 (patch) | |
tree | 4d5ff86fc8a5216850383149fbe35944c32adb69 /misc/getpass.c | |
parent | 3a66b2b0637e439fb0e7a14c6c3d4c58190eec61 (diff) | |
download | glibc-41389c40499a083c59e68ba281ec87be567f2871.zip glibc-41389c40499a083c59e68ba281ec87be567f2871.tar.gz glibc-41389c40499a083c59e68ba281ec87be567f2871.tar.bz2 |
Fix environment traversal when an envvar value is empty
The condition when the value of an envvar is empty (not just '\0'),
the loop in tunables_init gets stuck infinitely because envp is not
incremented. Fix that by always incrementing envp in the loop.
Added test case (tst-empty-env.c) verifies the fix when the source is
configured with --enable-hardcoded-path-in-tests, thanks Josh Stone for
providing the test case. Verified on x86_64.
* elf/dl-tunables (get_next_env): Always advance envp.
* stdlib/tst-empty-env.c: New test case.
* stdlib/Makefile (tests): Use it.
Diffstat (limited to 'misc/getpass.c')
0 files changed, 0 insertions, 0 deletions