From: Miroslav Lichvar Date: Wed, 8 Aug 2018 13:56:12 +0000 (+0200) Subject: ntp: add assertion to get_seperation() X-Git-Tag: 3.4-pre1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8aa4ae027bd596097bbe09b7fa608b0e39b8f59a;p=thirdparty%2Fchrony.git ntp: add assertion to get_seperation() --- diff --git a/ntp_core.c b/ntp_core.c index 5e40e900..c3580ebc 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -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);