summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog/newsyslog.c
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2014-02-13 04:54:47 +0000
committermarkj <markj@FreeBSD.org>2014-02-13 04:54:47 +0000
commit2a0c06b06734af87b60753f6646870c393aeb126 (patch)
treea38ef707284d5f5122fc38da3b31d661003d8bf2 /usr.sbin/newsyslog/newsyslog.c
parentb7969843d1787507419cfba9cb55e6ac13055fd9 (diff)
downloadFreeBSD-src-2a0c06b06734af87b60753f6646870c393aeb126.zip
FreeBSD-src-2a0c06b06734af87b60753f6646870c393aeb126.tar.gz
MFC r257600:
Initialize the struct tm before handing it to strptime(3).
Diffstat (limited to 'usr.sbin/newsyslog/newsyslog.c')
-rw-r--r--usr.sbin/newsyslog/newsyslog.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index 69a63c4..66856d2 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -1491,6 +1491,7 @@ validate_old_timelog(int fd, const struct dirent *dp, const char *logfname,
&dp->d_name[logfname_len]);
return (0);
}
+ memset(tm, 0, sizeof(*tm));
if ((s = strptime(&dp->d_name[logfname_len + 1],
timefnamefmt, tm)) == NULL) {
/*
OpenPOWER on IntegriCloud