From: Juergen Perlinger Date: Wed, 1 Dec 2010 22:05:13 +0000 (+0100) Subject: [Bug 1735] clocktime() aborts ntpd on bogus input: changed to regular error indication X-Git-Tag: NTP_4_2_7P88~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85c062a0d6ccc0fff11b5b65abc979acb3037c57;p=thirdparty%2Fntp.git [Bug 1735] clocktime() aborts ntpd on bogus input: changed to regular error indication bk: 4cf6c699yWL8awPoQYh_7_VrwwV8wA --- diff --git a/ChangeLog b/ChangeLog index 46bfaf014..fa1fb8e0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 1735] 'clocktime()' aborts ntpd on bogus input (4.2.7p87) 2010/12/01 Released by Harlan Stenn * from 4.2.6p3-RC12: Clean up m4 quoting in configure.ac, *.m4 files, resolving intermittent AC_LANG_PROGRAM possibly undefined errors. diff --git a/libntp/clocktime.c b/libntp/clocktime.c index 070672a2c..2781c6800 100644 --- a/libntp/clocktime.c +++ b/libntp/clocktime.c @@ -8,8 +8,6 @@ #include "ntp_stdlib.h" #include "ntp_calendar.h" -#include "ntp_assert.h" - /* * Hacks to avoid excercising the multiplier. I have no pride. */ @@ -136,11 +134,14 @@ clocktime( for (min = 1, idx = 0; idx < 3; idx++) if (diff[idx] < diff[min]) min = idx; - NTP_ENSURE(diff[min] <= NEARLIMIT); - - /* -*- store results and tell if we could get into CLOSETIME*/ - *ts_ui = test[min]; - *yearstart = ystt[min]; + if (diff[min] <= NEARLIMIT) { + /* -*- store results and update year start */ + *ts_ui = test[min]; + *yearstart = ystt[min]; + } else + *ts_ui = rec_ui; /* emergency fallback */ + + /* -*- tell if we could get into CLOSETIME*/ return diff[min] < CLOSETIME; }