From: Harlan Stenn Date: Sun, 29 Jul 2007 06:30:13 +0000 (-0400) Subject: Initialize offset in leap_file() - Coverity View 17 X-Git-Tag: NTP_4_2_5P63~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c10760dafdd2aed3883d4c71e17def200a143e84;p=thirdparty%2Fntp.git Initialize offset in leap_file() - Coverity View 17 bk: 46ac33f5RmwkLbYNu6H4oa4tjjRvRA --- diff --git a/ChangeLog b/ChangeLog index bfc9c9644..40b0d48cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* Initialize offset in leap_file() - Coverity View 17. * Use the correct stratum on KISS codes. * Fuzz bits cleanup. * Show more digits in some debug printf's. diff --git a/ntpd/ntp_util.c b/ntpd/ntp_util.c index 8dd242779..be38c0e8c 100644 --- a/ntpd/ntp_util.c +++ b/ntpd/ntp_util.c @@ -811,6 +811,7 @@ leap_file( * expiration time in NTP seconds. */ i = TAI_1972; + offset = 0; expire = 0; while (i < MAX_TAI) { dp = fgets(buf, NTP_MAXSTRLEN - 1, str); @@ -837,7 +838,7 @@ leap_file( i++; } fclose(str); - if (dp != NULL) { + if (offset == 0 || i != offset) { msyslog(LOG_INFO, "leap_file: %s error", cp); } else { leap_tai = offset;