]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1095] overflow in caljulian.c
authorHarlan Stenn <stenn@ntp.org>
Wed, 19 Nov 2008 22:18:03 +0000 (22:18 +0000)
committerHarlan Stenn <stenn@ntp.org>
Wed, 19 Nov 2008 22:18:03 +0000 (22:18 +0000)
bk: 4924909blIYcwpL0fyPwoM6QFdHzag

ChangeLog
libntp/caljulian.c

index 33cb517a8410439c1ba6cf098f473e1be3a84645..83bb47e6f76a26e9f921e2ec7b2e0816c7f4fb97 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 1095] overflow in caljulian.c.
 (4.2.5p144) 2008/11/19 Released by Harlan Stenn <stenn@ntp.org>
 * Use int32, not int32_t.
 * Avoid the sched*() functions under OSF - link problems.
index 158038de555fe4136211107ccfeba89807709df2..68ac6b3f0fcd2e3ea6d3e4995507955e6efca23a 100644 (file)
@@ -63,7 +63,8 @@ caljulian(
        tmplo = (u_int32)now;
        tmphi = (int32)(now >> 16 >> 16);
        
-       M_ADD(tmphi, tmplo, 1, LONG_MAX + JAN_1970);
+       M_ADD(tmphi, tmplo, 0, LONG_MAX);
+       M_ADD(tmphi, tmplo, 0, JAN_1970);
        if ((ntptime > tmplo) && (tmphi > 0))
                --tmphi;
        tmplo = ntptime;