From e4fff6acac20a240641485fc8fec5b008708c8a0 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Wed, 16 Apr 2014 21:14:47 -0400 Subject: [PATCH] Fix potential crash found by smatch. --- src/modules/passwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/passwd.c b/src/modules/passwd.c index 487cd96..86fb2c5 100644 --- a/src/modules/passwd.c +++ b/src/modules/passwd.c @@ -293,7 +293,7 @@ int ui_module_exec(char ***s, const struct passwd *pw, const int multi_char, switch (*p) { #ifdef HAVE_GETSPNAM case 'c': - if (!amroot) { + if (!amroot || !spwd) { add_string(&strings, "!"); break; } -- 2.11.4.GIT