]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Don't try to dereference a NULL pw pointer. This would happen when
authorJoerg Wunsch <joerg@FreeBSD.org>
Tue, 29 Oct 2002 12:45:32 +0000 (12:45 +0000)
committerJoerg Wunsch <joerg@FreeBSD.org>
Tue, 29 Oct 2002 12:45:32 +0000 (12:45 +0000)
attempting to use chpass -a.

chpass/chpass.c

index 22ca2ac7d1301ad6340e01189a1c7cbc13728de5..ba8baaa6aaec44bca3bb244d54f7e29726278c1c 100644 (file)
@@ -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 &&