Another overrun forgotten in previous commit, also found by Coverity.

CID 1481.
This commit is contained in:
elad 2006-03-17 20:44:28 +00:00
parent ab24a02ffe
commit cbe6a15c01
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: utmpentry.c,v 1.6 2006/03/17 20:41:02 elad Exp $ */
/* $NetBSD: utmpentry.c,v 1.7 2006/03/17 20:44:28 elad Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: utmpentry.c,v 1.6 2006/03/17 20:41:02 elad Exp $");
__RCSID("$NetBSD: utmpentry.c,v 1.7 2006/03/17 20:44:28 elad Exp $");
#endif
#include <sys/stat.h>
@ -274,7 +274,7 @@ getentry(struct utmpentry *e, struct utmp *up)
(void)strncpy(e->line, up->ut_line, sizeof(up->ut_line));
e->line[sizeof(e->line) - 1] = '\0';
(void)strncpy(e->host, up->ut_host, sizeof(up->ut_host));
e->name[sizeof(e->host) - 1] = '\0';
e->name[sizeof(e->name) - 1] = '\0';
e->tv.tv_sec = up->ut_time;
e->tv.tv_usec = 0;
adjust_size(e);