From c6bdbf6e93a11227f91fbf15b7a36dceb60c526d Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 21 Sep 2018 14:18:33 +0200 Subject: environment: Allow default env path to be NULL Several places assume that the default environment path cannot be NULL. Allow NULL here without crashing. Signed-off-by: Sascha Hauer --- commands/loadenv.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'commands') diff --git a/commands/loadenv.c b/commands/loadenv.c index 6469affadb..bf01072c42 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -61,6 +61,10 @@ static int do_loadenv(int argc, char *argv[]) if (argc - optind < 1) { filename = default_environment_path_get(); + if (!filename) { + printf("Default environment path not set\n"); + return 1; + } } else { /* * /dev/defaultenv use to contain the defaultenvironment. -- cgit v1.2.3