diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2001-11-26 06:05:24 +0000 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2001-11-26 06:05:24 +0000 |
commit | fc78bb8523d8d6a2c90ded155b555e956156c2b1 (patch) | |
tree | 78ea8b949cc2d3f5fb1e2eec3f671a556b2809a4 /modules/pam_unix/support.c | |
parent | 820ef4f92f20eed02bee458cff35da22662a4631 (diff) | |
download | pam-fc78bb8523d8d6a2c90ded155b555e956156c2b1.tar.gz pam-fc78bb8523d8d6a2c90ded155b555e956156c2b1.tar.bz2 pam-fc78bb8523d8d6a2c90ded155b555e956156c2b1.zip |
Relevant BUGIDs: 476947
Purpose of commit: cleanup
Commit summary:
---------------
be more confident that strings are being initialized correctly
from Nalin.
Diffstat (limited to 'modules/pam_unix/support.c')
-rw-r--r-- | modules/pam_unix/support.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c index 6b8b8020..9b6b19a2 100644 --- a/modules/pam_unix/support.c +++ b/modules/pam_unix/support.c @@ -123,9 +123,10 @@ char *PAM_getlogin(void) D(("PAM_getlogin ttyname: %s", curr_tty)); curr_tty += 5; setutent(); - strncpy(line.ut_line, curr_tty, sizeof line.ut_line); + strncpy(line.ut_line, curr_tty, sizeof(line.ut_line)); if ((ut = getutline(&line)) != NULL) { strncpy(curr_user, ut->ut_user, sizeof(ut->ut_user)); + curr_user[sizeof(curr_user) - 1] = '\0'; retval = curr_user; } endutent(); |