Skip to content
Commit 41389c40 authored by Siddhesh Poyarekar's avatar Siddhesh Poyarekar
Browse files

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.
parent 3a66b2b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment