From 9e8947d9e606b967d0792d0ab1ee7afac5e5f39d Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 15 Feb 2008 02:24:04 +0000 Subject: [PATCH] 2333. [bug] Fix off by one error in isc_time_nowplusinterval(). [RT #17608] --- CHANGES | 3 +++ lib/isc/unix/time.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 6b09df1f44..af7595575f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2333. [bug] Fix off by one error in isc_time_nowplusinterval(). + [RT #17608] + 2332. [contrib] query-loc-0.4.0. [RT #17602] 2331. [bug] Failure to regenerate any signatures was not being diff --git a/lib/isc/unix/time.c b/lib/isc/unix/time.c index 70fd2e1867..ebfcc04541 100644 --- a/lib/isc/unix/time.c +++ b/lib/isc/unix/time.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: time.c,v 1.54 2007/06/18 23:47:48 tbox Exp $ */ +/* $Id: time.c,v 1.55 2008/02/15 02:24:04 marka Exp $ */ /*! \file */ @@ -227,7 +227,7 @@ isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i) { t->seconds = tv.tv_sec + i->seconds; t->nanoseconds = tv.tv_usec * NS_PER_US + i->nanoseconds; - if (t->nanoseconds > NS_PER_S) { + if (t->nanoseconds >= NS_PER_S) { t->seconds++; t->nanoseconds -= NS_PER_S; }