]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Make sure skew isn't 0.0 to avoid segfaults
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 5 May 2009 06:52:33 +0000 (08:52 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 5 May 2009 06:52:33 +0000 (08:52 +0200)
reference.c

index b7313e9ab15d1a07d16ea0c960ed692cd9d7b7a3..1be04b173af6d82d928b0f9a7170f3f289df031a 100644 (file)
@@ -379,6 +379,12 @@ REF_SetReference(int stratum,
 
   assert(initialised);
 
+  /* Avoid getting NaNs */
+  if (skew == 0.0)
+    skew = 1e-10;
+  if (our_skew == 0.0)
+    our_skew = 1e-10;
+
   /* If we get a serious rounding error in the source stats regression
      processing, there is a remote chance that the skew argument is a
      'not a number'.  If such a quantity gets propagated into the