pam: Check for null upwd from getpwnam_r
authorAndrew Deason <adeason@sinenomine.net>
Wed, 13 Apr 2011 16:10:52 +0000 (11:10 -0500)
committerDerrick Brashear <shadow@dementia.org>
Fri, 15 Apr 2011 17:13:01 +0000 (10:13 -0700)
commitfbb4c6115b9af9c52ee06fa9c979a3f4195ad342
tree2c5faa5e9ec0bfe03f24d46b5b200fb0532a06c4
parenta7d4fbd36a120b16caaddcd9d1c7f550cb14aae5
pam: Check for null upwd from getpwnam_r

The POSIX getpwnam_r can yield a NULL struct passwd pointer even when
the returned error code is 0 (in particular, when the requested entry
is not found). Just add a check for a null upwd to make sure we don't
dereference a NULL pointer.

Change-Id: I00e8d6c53e8228f468c984010695b798f5dcf999
Reviewed-on: http://gerrit.openafs.org/4469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/pam/afs_auth.c
src/pam/afs_password.c
src/pam/afs_setcred.c