]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
client: avoid undefined bit shifts
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 24 Jul 2017 11:24:17 +0000 (13:24 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 25 Jul 2017 15:40:35 +0000 (17:40 +0200)
client.c

index 5e179df91fc7bd4467b8e9fde014b433ed98e73f..fa9e14e916d026a79d1cc8d92831791e673b3850 100644 (file)
--- a/client.c
+++ b/client.c
@@ -315,7 +315,7 @@ bits_to_mask(int bits, int family, IPAddr *mask)
   mask->family = family;
   switch (family) {
     case IPADDR_INET4:
-      if (bits < 0)
+      if (bits > 32 || bits < 0)
         bits = 32;
       if (bits > 0) {
         mask->addr.in4 = -1;
@@ -2809,7 +2809,7 @@ process_cmd_retries(const char *line)
   int retries;
 
   retries = atoi(line);
-  if (retries < 0) {
+  if (retries < 0 || retries > 30) {
     LOG(LOGS_ERR, "Invalid maximum number of retries");
     return 0;
   }