]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Add asserts for timeout delays
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 23 Jun 2011 11:42:04 +0000 (13:42 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 23 Jun 2011 11:42:04 +0000 (13:42 +0200)
sched.c

diff --git a/sched.c b/sched.c
index a08baa1f0349458e3c6657156e7fc42c480274a4..954521200363643aaab9e93eb957e85f166222a2 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -318,6 +318,7 @@ SCH_AddTimeoutByDelay(double delay, SCH_TimeoutHandler handler, SCH_ArbitraryArg
   struct timeval now, then;
 
   assert(initialised);
+  assert(delay >= 0.0);
 
   LCL_ReadRawTime(&now);
   UTI_AddDoubleToTimeval(&now, delay, &then);
@@ -339,6 +340,7 @@ SCH_AddTimeoutInClass(double min_delay, double separation, double randomness,
   double new_min_delay;
 
   assert(initialised);
+  assert(min_delay >= 0.0);
   assert(class < SCH_NumberOfClasses);
 
   if (randomness > 0.0) {