From fc78bb8523d8d6a2c90ded155b555e956156c2b1 Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Mon, 26 Nov 2001 06:05:24 +0000 Subject: Relevant BUGIDs: 476947 Purpose of commit: cleanup Commit summary: --------------- be more confident that strings are being initialized correctly from Nalin. --- modules/pam_unix/support.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/pam_unix/support.c') 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(); -- cgit v1.2.3