]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3360. [bug] 'host -w' could die. [RT #18723]
authorMark Andrews <marka@isc.org>
Tue, 14 Aug 2012 01:10:53 +0000 (11:10 +1000)
committerMark Andrews <marka@isc.org>
Tue, 14 Aug 2012 01:10:53 +0000 (11:10 +1000)
CHANGES
lib/isc/pthreads/condition.c

diff --git a/CHANGES b/CHANGES
index 017358eda1d33d7ec2d899ec73e4220abd504a7f..d7cd933b6cd20cca9a266e3d1ba5d95841a26f67 100644 (file)
--- 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]
 
index 50281a2b87cb3c63dbfb7cbd6e02c2e75c52d1cc..ca33e66cf494b4fa5ad802ac9e8e075a12f3f076 100644 (file)
@@ -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);
 
        /*!