os:getenv/1
incorrectly handles environment variables with trailing =
#9401
Labels
bug
Issue is reported as a bug
Describe the Bug
Erlang's
os:getenv/1
function fails to correctly retrieve environment variables when their value contains a trailing equals sign (=
). This common with base64 encoded secrets (paddingà.This issue affects both Erlang and Elixir.
To Reproduce
Set an environment variable that contains a trailing equals sign (
=
):Verify that the variable is correctly set:
Attempt to retrieve the variable using Erlang:
Expected Behavior
Erlang's
os:getenv/1
should correctly return the environment variable's full value, including any trailing=
characters, only null bytes are invalid.Other programming languages, such as Python and Bash, handle this correctly:
Python:
python -c "import os; print(os.getenv('HELLO', ''))" WORLD=
Bash:
Would appreciate any insights regarding this behavior!
Affected versions
27 (I assume all versions prior)
The text was updated successfully, but these errors were encountered: