]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Initialize offset in leap_file() - Coverity View 17
authorHarlan Stenn <stenn@ntp.org>
Sun, 29 Jul 2007 06:30:13 +0000 (02:30 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sun, 29 Jul 2007 06:30:13 +0000 (02:30 -0400)
bk: 46ac33f5RmwkLbYNu6H4oa4tjjRvRA

ChangeLog
ntpd/ntp_util.c

index bfc9c9644de2525fe5b1d873ed4f806eaf9a062b..40b0d48cd88ba1727a30fc53c1e9c5b42c1ebcfd 100644 (file)
--- 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.
index 8dd242779d9f7499202597cd24db45a202ba8366..be38c0e8c223ba5f30b0e0affdbc3fcc98c5653d 100644 (file)
@@ -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;