From: Danny Mayer Date: Tue, 8 Mar 2005 04:18:40 +0000 (-0500) Subject: Check for max value of skips before adding X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc4485f3e4bf2e5ecde1400e32ab1a84d662922b;p=thirdparty%2Fntp.git Check for max value of skips before adding bk: 422d27a0pMWdbQFO8gJiabtlhxauvA --- diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 2614657761..1a1ef67e07 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -1924,7 +1924,7 @@ input_handler( packets_dropped++; if (buflen > 0) nonzeroreads++; - else + else if (totskips < MAXSKIPS) { skiplist[totskips] = fd; totskips++; @@ -1946,13 +1946,16 @@ input_handler( netsyslog(LOG_ERR, "clock read fd %d: %m", fd); } freerecvbuf(rb); - skiplist[totskips] = fd; - totskips++; + if (totskips < MAXSKIPS) + { + skiplist[totskips] = fd; + totskips++; + } continue; } if(buflen > 0) nonzeroreads++; - else + else if (totskips < MAXSKIPS) { skiplist[totskips] = fd; totskips++;