From ba7201c3c30bf9d74db3b54f666ec541661760bf Mon Sep 17 00:00:00 2001 From: Andrew Wilcox Date: Sat, 9 Apr 2016 12:47:40 -0500 Subject: Don't strlen(NULL) if environment is unset --- getconf/getconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3-60-g2f50