From 313997542e1665f21555249c1cf80f7960c5f946 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Tue, 29 Oct 2002 12:45:32 +0000 Subject: Don't try to dereference a NULL pw pointer. This would happen when attempting to use chpass -a. --- chpass/chpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chpass') diff --git a/chpass/chpass.c b/chpass/chpass.c index 22ca2ac..ba8baaa 100644 --- a/chpass/chpass.c +++ b/chpass/chpass.c @@ -166,7 +166,7 @@ main(int argc, char *argv[]) } #ifdef YP - if ((pw->pw_fields & _PWF_SOURCE) == _PWF_NIS) { + if (pw != NULL && (pw->pw_fields & _PWF_SOURCE) == _PWF_NIS) { ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host); master_mode = (ypclnt != NULL && ypclnt_connect(ypclnt) != -1 && -- cgit v1.2.3-56-ge451