Check for NULL return from getpwnam_shadowmaster
commit9c25b99ff27f8af74c6bb8b754ec2f8c9442a69b
authorAntoine Jacoutot <ajacoutot@openbsd.org>
Sat, 11 Mar 2023 12:41:28 +0000 (11 13:41 +0100)
committerAntoine Jacoutot <ajacoutot@openbsd.org>
Sat, 11 Mar 2023 12:42:03 +0000 (11 13:42 +0100)
tree31ed3cebaa2276c4558cd41969a2f5286de53f09
parent69dab252159e42b608ac274ab8327282bf365e0a
Check for NULL return from getpwnam_shadow

Check if `getpwnam_shadow` returns NULL (for instance, if
checking for a user that does not exist) before calling
`pw_dup`, which will segfault on NULL.

Debugged and fixed by Dan Cross, thanks!
login_passwd/login.c