]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: add assertion to get_seperation()
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 8 Aug 2018 13:56:12 +0000 (15:56 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 9 Aug 2018 12:33:48 +0000 (14:33 +0200)
ntp_core.c

index 5e40e9001001a7a1d1a2da81da246777b3e4291c..c3580ebc6e2cbfd7327d54e5809594f91dec65df 100644 (file)
@@ -899,6 +899,8 @@ get_separation(int poll)
 {
   double separation;
 
+  assert(poll >= MIN_POLL && poll <= MAX_POLL);
+
   /* Allow up to 8 sources using the same short interval to not be limited
      by the separation */
   separation = UTI_Log2ToDouble(poll - 3);