diff options
author | Toomas Soome <tsoome@me.com> | 2019-01-22 22:53:42 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-06-28 22:33:48 +0300 |
commit | d646956405faf5fdc9460e6b19af1bcb7a5c11ae (patch) | |
tree | 02a176b398baca38db6818b6ddf70f405bbb2445 /usr | |
parent | da7753c428994e4e6c715886c93d7b49390c3705 (diff) | |
download | illumos-joyent-d646956405faf5fdc9460e6b19af1bcb7a5c11ae.tar.gz |
11171 pam_modules: NULL pointer errors
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Reviewed by: Gergő Doma <domag02@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/lib/pam_modules/dhkeys/dhkeys.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr/src/lib/pam_modules/dhkeys/dhkeys.c b/usr/src/lib/pam_modules/dhkeys/dhkeys.c index b37e422296..bcde37a8b3 100644 --- a/usr/src/lib/pam_modules/dhkeys/dhkeys.c +++ b/usr/src/lib/pam_modules/dhkeys/dhkeys.c @@ -257,8 +257,9 @@ establish_key(pam_handle_t *pamh, int flags, int debug, char *netname) if (passwd) { (void) strlcpy(short_pass, passwd, sizeof (short_pass)); short_passp = short_pass; - } else + } else { short_passp = NULL; + } if (mechs = __nis_get_mechanisms(FALSE)) { @@ -408,7 +409,7 @@ remove_key(pam_handle_t *pamh, int flags, int debug) pthread_t tid; (void) pam_get_item(pamh, PAM_USER, (void **)&uname); - if (uname == NULL || *uname == NULL) { + if (uname == NULL || *uname == '\0') { if (debug) syslog(LOG_DEBUG, "pam_dhkeys: user NULL or empty in remove_key()"); @@ -442,8 +443,9 @@ remove_key(pam_handle_t *pamh, int flags, int debug) pwu_rep->type = auth_rep->type; pwu_rep->scope = auth_rep->scope; pwu_rep->scope_len = auth_rep->scope_len; - } else + } else { pwu_rep = PWU_DEFAULT_REP; + } /* Retrieve user's uid/gid from the password repository */ attr_pw[0].type = ATTR_UID; attr_pw[0].next = &attr_pw[1]; |