summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2002-10-29 12:45:32 +0000
committerjoerg <joerg@FreeBSD.org>2002-10-29 12:45:32 +0000
commitd2db0b5c9be9523dffc2c83e71bb546b72779af1 (patch)
tree1e87618d9234b5c020a3ff2a3563193d9ff89961
parentce6ecab91ba9b55f73aef9528c357cdcfd5733ba (diff)
downloadFreeBSD-src-d2db0b5c9be9523dffc2c83e71bb546b72779af1.zip
FreeBSD-src-d2db0b5c9be9523dffc2c83e71bb546b72779af1.tar.gz
Don't try to dereference a NULL pw pointer. This would happen when
attempting to use chpass -a.
-rw-r--r--usr.bin/chpass/chpass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c
index 22ca2ac..ba8baaa 100644
--- a/usr.bin/chpass/chpass.c
+++ b/usr.bin/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 &&
OpenPOWER on IntegriCloud