From: Miroslav Lichvar Date: Tue, 5 May 2009 06:52:33 +0000 (+0200) Subject: Make sure skew isn't 0.0 to avoid segfaults X-Git-Tag: 1.24-pre1~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef3669fe1b271f9fdcbac6db11da98baeed5836e;p=thirdparty%2Fchrony.git Make sure skew isn't 0.0 to avoid segfaults --- diff --git a/reference.c b/reference.c index b7313e9a..1be04b17 100644 --- a/reference.c +++ b/reference.c @@ -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