summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Wilcox <AWilcox@Wilcox-Tech.com>2016-04-09 12:47:40 -0500
committerAndrew Wilcox <AWilcox@Wilcox-Tech.com>2016-04-09 12:47:40 -0500
commitba7201c3c30bf9d74db3b54f666ec541661760bf (patch)
tree0f48b1dc458e650346d9f8ba14ebe7cc19f5faf9
parent52eb352e78517ec70f1b3c626a49f789274c8caa (diff)
downloadshimmy-ba7201c3c30bf9d74db3b54f666ec541661760bf.tar.gz
shimmy-ba7201c3c30bf9d74db3b54f666ec541661760bf.tar.bz2
shimmy-ba7201c3c30bf9d74db3b54f666ec541661760bf.tar.xz
shimmy-ba7201c3c30bf9d74db3b54f666ec541661760bf.zip
Don't strlen(NULL) if environment is unset
-rw-r--r--getconf/getconf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/getconf/getconf.c b/getconf/getconf.c
index 0f2b5d0..7c789dd 100644
--- a/getconf/getconf.c
+++ b/getconf/getconf.c
@@ -389,7 +389,7 @@ int do_system_var(char *environment, char *system_var)
{
int var;
- if(strlen(environment) != 0)
+ if(environment && strlen(environment) != 0)
{
fprintf(stderr, "Unsupported environment: %s\n", environment);
return EINVAL;