From: Mark Andrews Date: Tue, 14 Aug 2012 01:10:53 +0000 (+1000) Subject: 3360. [bug] 'host -w' could die. [RT #18723] X-Git-Tag: v9.7.7rc1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3eacfaad7c9ed5c73cf57903a06fa61b334db61;p=thirdparty%2Fbind9.git 3360. [bug] 'host -w' could die. [RT #18723] --- diff --git a/CHANGES b/CHANGES index 017358eda1d..d7cd933b6cd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3360. [bug] 'host -w' could die. [RT #18723] + 3359. [bug] An improperly-formed TSIG secret could cause a memory leak. [RT #30607] diff --git a/lib/isc/pthreads/condition.c b/lib/isc/pthreads/condition.c index 50281a2b87c..ca33e66cf49 100644 --- a/lib/isc/pthreads/condition.c +++ b/lib/isc/pthreads/condition.c @@ -43,7 +43,14 @@ isc_condition_waituntil(isc_condition_t *c, isc_mutex_t *m, isc_time_t *t) { * POSIX defines a timespec's tv_sec as time_t. */ result = isc_time_secondsastimet(t, &ts.tv_sec); - if (result != ISC_R_SUCCESS) + + /* + * If we have a range error ts.tv_sec is most probably a signed + * 32 bit value. Set ts.tv_sec to INT_MAX. This is a kludge. + */ + if (result == ISC_R_RANGE) + ts.tv_sec = INT_MAX; + else if (result != ISC_R_SUCCESS) return (result); /*!