]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
reference: clamp local stratum set from cmdmon
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 8 Apr 2016 10:34:48 +0000 (12:34 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 8 Apr 2016 14:21:15 +0000 (16:21 +0200)
reference.c

index c531356f35259987876120163cad788580cbed9b..61a356bd65a9041c80ce49596c13f23d0b5b011e 100644 (file)
@@ -1314,7 +1314,7 @@ void
 REF_EnableLocal(int stratum)
 {
   enable_local_stratum = 1;
-  local_stratum = stratum;
+  local_stratum = CLAMP(1, stratum, NTP_MAX_STRATUM - 1);
 }
 
 /* ================================================== */