Skip to content

Commit

Permalink
CLIENT:PAM: avoid NULL deref
Browse files Browse the repository at this point in the history
This is hardly possible in the wild but should fix Coverity
complain.
  • Loading branch information
alexey-tikhonov committed Sep 30, 2024
1 parent ef2a618 commit c66d9e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/sss_client/pam_sss.c
Original file line number Diff line number Diff line change
Expand Up @@ -2370,9 +2370,11 @@ static int prompt_sc_pin(pam_handle_t *pamh, struct pam_items *pi)
ret = PAM_SUCCESS;

done:
sss_erase_mem_securely((void *)answer, strlen(answer));
free(answer);
answer=NULL;
if (answer != NULL) {
sss_erase_mem_securely((void *)answer, strlen(answer));
free(answer);
answer=NULL;
}

if (resp != NULL) {
if (resp[0].resp != NULL) {
Expand Down

0 comments on commit c66d9e8

Please sign in to comment.