diff options
| author | shm <shm@NetBSD.org> | 2015-08-09 12:17:30 +0000 |
|---|---|---|
| committer | shm <shm@NetBSD.org> | 2015-08-09 12:17:30 +0000 |
| commit | aadb6b92c53b68b4e40bf11a6ed6e2a95762f893 (patch) | |
| tree | 8c002c2ca82dc0e57c56a86d1c0d263984054042 /libexec | |
| parent | 599dc3c5bec185475cbf7b17eb653a1a70873937 (diff) | |
Clear utmpx struct before writing it to wtmpx files
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/ftpd/logwtmp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libexec/ftpd/logwtmp.c b/libexec/ftpd/logwtmp.c index 50135514a46..ee7f7e23c94 100644 --- a/libexec/ftpd/logwtmp.c +++ b/libexec/ftpd/logwtmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: logwtmp.c,v 1.25 2006/09/23 16:03:50 xtraeme Exp $ */ +/* $NetBSD: logwtmp.c,v 1.26 2015/08/09 12:17:30 shm Exp $ */ /* * Copyright (c) 1988, 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: logwtmp.c,v 1.25 2006/09/23 16:03:50 xtraeme Exp $"); +__RCSID("$NetBSD: logwtmp.c,v 1.26 2015/08/09 12:17:30 shm Exp $"); #endif #endif /* not lint */ @@ -124,6 +124,7 @@ ftpd_logwtmpx(const char *line, const char *name, const char *host, if (fdx < 0) return; if (fstat(fdx, &buf) == 0) { + (void)memset(&ut, 0, sizeof(ut)); (void)strncpy(ut.ut_line, line, sizeof(ut.ut_line)); (void)strncpy(ut.ut_name, name, sizeof(ut.ut_name)); (void)strncpy(ut.ut_host, host, sizeof(ut.ut_host)); |
