mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-27 03:11:52 +01:00
Avoid possible null deref if ypclnt_new returns null
PR: bin/172979 Submitted by: Erik Cederstrand <erik@cederstrand.dk> Approved by: cperciva MFC after: 3 days
This commit is contained in:
parent
d207a5583c
commit
fd773ca3dd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243081
@ -241,8 +241,11 @@ main(int argc, char *argv[])
|
||||
#ifdef YP
|
||||
case _PWF_NIS:
|
||||
ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host);
|
||||
if (ypclnt == NULL ||
|
||||
ypclnt_connect(ypclnt) == -1 ||
|
||||
if (ypclnt == NULL) {
|
||||
warnx("ypclnt_new failed");
|
||||
exit(1);
|
||||
}
|
||||
if (ypclnt_connect(ypclnt) == -1 ||
|
||||
ypclnt_passwd(ypclnt, pw, password) == -1) {
|
||||
warnx("%s", ypclnt->error);
|
||||
ypclnt_free(ypclnt);
|
||||
|
Loading…
Reference in New Issue
Block a user