From 8aa4ae027bd596097bbe09b7fa608b0e39b8f59a Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 8 Aug 2018 15:56:12 +0200 Subject: [PATCH] ntp: add assertion to get_seperation() --- ntp_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ntp_core.c b/ntp_core.c index 5e40e90..c3580eb 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);