From 5715fd569d6f8258830bb1808f9b65bde72cc5cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Thu, 28 Mar 2019 18:59:55 +0100 Subject: [PATCH] afb-args: Use secure_getenv MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Improves security of the binder by using secure_getenv instead of getenv. Change-Id: Iffd56ca65251763aacb0b9dbbaa768619cd92dd4 Signed-off-by: José Bollo --- src/afb-config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/afb-config.c b/src/afb-config.c index 1cc84b02..87fad97e 100644 --- a/src/afb-config.c +++ b/src/afb-config.c @@ -969,7 +969,7 @@ void afb_config_dump(struct json_object *config) static void on_environment(struct json_object *config, int optid, const char *name, void (*func)(struct json_object*, int, const char*)) { - char *value = getenv(name); + char *value = secure_getenv(name); if (value && *value) func(config, optid, value); @@ -977,7 +977,7 @@ static void on_environment(struct json_object *config, int optid, const char *na static void on_environment_enum(struct json_object *config, int optid, const char *name, int (*func)(const char*)) { - char *value = getenv(name); + char *value = secure_getenv(name); if (value) { if (func(value) == -1) @@ -989,7 +989,7 @@ static void on_environment_enum(struct json_object *config, int optid, const cha static void on_environment_bool(struct json_object *config, int optid, const char *name) { - char *value = getenv(name); + char *value = secure_getenv(name); int asbool; if (value) { -- 2.16.6