diff options
author | Andrew Wilcox <AWilcox@Wilcox-Tech.com> | 2016-04-09 12:47:40 -0500 |
---|---|---|
committer | Andrew Wilcox <AWilcox@Wilcox-Tech.com> | 2016-04-09 12:47:40 -0500 |
commit | ba7201c3c30bf9d74db3b54f666ec541661760bf (patch) | |
tree | 0f48b1dc458e650346d9f8ba14ebe7cc19f5faf9 /getconf | |
parent | 52eb352e78517ec70f1b3c626a49f789274c8caa (diff) | |
download | shimmy-ba7201c3c30bf9d74db3b54f666ec541661760bf.tar.gz shimmy-ba7201c3c30bf9d74db3b54f666ec541661760bf.tar.bz2 shimmy-ba7201c3c30bf9d74db3b54f666ec541661760bf.tar.xz shimmy-ba7201c3c30bf9d74db3b54f666ec541661760bf.zip |
Don't strlen(NULL) if environment is unset
Diffstat (limited to 'getconf')
-rw-r--r-- | getconf/getconf.c | 2 |
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; |