Use secure_getenv() instead of getenv() where appropriate

This commit is contained in:
Busayo Dada
2025-04-12 11:48:22 +01:00
committed by Luca Boccassi
parent a681435015
commit a51804a5ff
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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;