diff options
author | Adam Tkac <atkac@fedoraproject.org> | 2007-07-17 06:09:36 +0000 |
---|---|---|
committer | Adam Tkac <atkac@fedoraproject.org> | 2007-07-17 06:09:36 +0000 |
commit | f3718dfd1bcbbaa8ca7040eec261de7ef4a81786 (patch) | |
tree | 0d8df5c19bf5c78681c601c0a9e9bb0df5faf821 /bind-9.5-overflow.patch | |
parent | 9c2a844c6c5b0aa6570c77d0defaa93523d2ee51 (diff) | |
download | bind-f3718dfd1bcbbaa8ca7040eec261de7ef4a81786.tar.gz bind-f3718dfd1bcbbaa8ca7040eec261de7ef4a81786.tar.xz bind-f3718dfd1bcbbaa8ca7040eec261de7ef4a81786.zip |
handle integer overflow in isc_time_secondsastimet more gracefullybind-9_5_0a5-3_fc8
(#247856)
Diffstat (limited to 'bind-9.5-overflow.patch')
-rw-r--r-- | bind-9.5-overflow.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bind-9.5-overflow.patch b/bind-9.5-overflow.patch new file mode 100644 index 0000000..34b7bed --- /dev/null +++ b/bind-9.5-overflow.patch @@ -0,0 +1,24 @@ +diff -up bind-9.5.0a5/lib/isc/pthreads/condition.c.overflow bind-9.5.0a5/lib/isc/pthreads/condition.c +--- bind-9.5.0a5/lib/isc/pthreads/condition.c.overflow 2007-07-17 07:53:59.000000000 +0200 ++++ bind-9.5.0a5/lib/isc/pthreads/condition.c 2007-07-17 07:55:08.000000000 +0200 +@@ -43,7 +43,7 @@ isc_condition_waituntil(isc_condition_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 (result != ISC_R_RANGE && result != ISC_R_SUCCESS) + return (result); + + /*! +diff -up bind-9.5.0a5/lib/isc/unix/time.c.overflow bind-9.5.0a5/lib/isc/unix/time.c +--- bind-9.5.0a5/lib/isc/unix/time.c.overflow 2007-02-14 01:27:27.000000000 +0100 ++++ bind-9.5.0a5/lib/isc/unix/time.c 2007-07-17 07:53:08.000000000 +0200 +@@ -379,6 +379,9 @@ isc_time_secondsastimet(const isc_time_t + * (Let's hope the compiler got the actual test right.) + */ + UNUSED(i); ++ ++ /* Means that t->seconds > maximum value in time_t and we have int time_t */ ++ seconds = INT_MAX; + return (ISC_R_RANGE); + } |