Validate the data returned by getgrnam() and getpwnam()

getgrnam() returns NULL if the group is not present and getpwnam()
returns NULL if the passwd entry is not present for a given user. Add
NULL checks before accessing the data returned by these.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2 files changed