summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-09-21 14:18:33 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-09-21 14:18:35 +0200
commitc6bdbf6e93a11227f91fbf15b7a36dceb60c526d (patch)
tree9ab0f7472fca0a91ecd0f41d3b1caf167ff34f2d /commands
parent16a3b9f241861aaf7ddd6f284e111aad291c508f (diff)
downloadbarebox-c6bdbf6e93a11227f91fbf15b7a36dceb60c526d.tar.gz
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 <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/loadenv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/commands/loadenv.c b/commands/loadenv.c
index 6469aff..bf01072 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.