From: Harlan Stenn Date: Wed, 19 Nov 2008 22:18:03 +0000 (+0000) Subject: [Bug 1095] overflow in caljulian.c X-Git-Tag: NTP_4_2_5P145~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa6b4971468ee7b54e9f72b4e05d9814affa1039;p=thirdparty%2Fntp.git [Bug 1095] overflow in caljulian.c bk: 4924909blIYcwpL0fyPwoM6QFdHzag --- diff --git a/ChangeLog b/ChangeLog index 33cb517a8..83bb47e6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 1095] overflow in caljulian.c. (4.2.5p144) 2008/11/19 Released by Harlan Stenn * Use int32, not int32_t. * Avoid the sched*() functions under OSF - link problems. diff --git a/libntp/caljulian.c b/libntp/caljulian.c index 158038de5..68ac6b3f0 100644 --- a/libntp/caljulian.c +++ b/libntp/caljulian.c @@ -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;