mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-30 05:36:10 +00:00
pam_xdg: pam_get_item can return NULL
Fix pam_xdg as pam_get_item can return NULL, this happens when pressing control + C in xdm for example. MFC after: 1 week PR: 279268
This commit is contained in:
parent
f5f40dd63b
commit
cca0ce62f3
|
@ -67,7 +67,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused,
|
|||
|
||||
/* Get user info */
|
||||
rv = pam_get_item(pamh, PAM_USER, (const void **)&user);
|
||||
if (rv != PAM_SUCCESS) {
|
||||
if (rv != PAM_SUCCESS || user == NULL) {
|
||||
PAM_VERBOSE_ERROR("Can't get user information");
|
||||
goto out;
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ _pam_xdg_close(pam_handle_t *pamh __unused, int flags __unused,
|
|||
|
||||
/* Get user info */
|
||||
rv = pam_get_item(pamh, PAM_USER, (const void **)&user);
|
||||
if (rv != PAM_SUCCESS) {
|
||||
if (rv != PAM_SUCCESS || user == NULL) {
|
||||
PAM_VERBOSE_ERROR("Can't get user information");
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue