Use secure_getenv() instead of getenv() where appropriate
This commit is contained in:
committed by
Luca Boccassi
parent
a681435015
commit
a51804a5ff
@@ -546,7 +546,7 @@ char* strv_env_get_n(char * const *l, const char *name, size_t k, ReplaceEnvFlag
|
||||
return NULL;
|
||||
|
||||
t = strndupa_safe(name, k);
|
||||
return getenv(t);
|
||||
return secure_getenv(t);
|
||||
};
|
||||
|
||||
return NULL;
|
||||
@@ -1105,7 +1105,7 @@ int getenv_steal_erase(const char *name, char **ret) {
|
||||
* it from there. Usecase: reading passwords from the env block (which is a bad idea, but useful for
|
||||
* testing, and given that people are likely going to misuse this, be thorough) */
|
||||
|
||||
e = getenv(name);
|
||||
e = secure_getenv(name);
|
||||
if (!e) {
|
||||
if (ret)
|
||||
*ret = NULL;
|
||||
|
||||
Reference in New Issue
Block a user