Blame SOURCES/ntp-4.2.6p5-cve-2016-9311.patch

6e16f6
diff -up ntp-4.2.6p5/ntpd/ntp_control.c.cve-2016-9311 ntp-4.2.6p5/ntpd/ntp_control.c
6e16f6
--- ntp-4.2.6p5/ntpd/ntp_control.c.cve-2016-9311	2016-11-21 16:14:42.800048565 +0100
6e16f6
+++ ntp-4.2.6p5/ntpd/ntp_control.c	2016-11-21 16:18:24.484590147 +0100
6e16f6
@@ -3080,6 +3080,22 @@ report_event(
6e16f6
 	if (num_ctl_traps <= 0)
6e16f6
 		return;
6e16f6
 
6e16f6
+	/* [Bug 3119]
6e16f6
+	 * Peer Events should be associated with a peer -- hence the
6e16f6
+	 * name. But there are instances where this function is called
6e16f6
+	 * *without* a valid peer. This happens e.g. with an unsolicited
6e16f6
+	 * CryptoNAK, or when a leap second alarm is going off while
6e16f6
+	 * currently without a system peer.
6e16f6
+	 *
6e16f6
+	 * The most sensible approach to this seems to bail out here if
6e16f6
+	 * this happens. Avoiding to call this function would also
6e16f6
+	 * bypass the log reporting in the first part of this function,
6e16f6
+	 * and this is probably not the best of all options.
6e16f6
+	 *   -*-perlinger@ntp.org-*-
6e16f6
+	 */
6e16f6
+	if ((err & PEER_EVENT) && !peer)
6e16f6
+		return;
6e16f6
+
6e16f6
 	/*
6e16f6
 	 * Set up the outgoing packet variables
6e16f6
 	 */
6e16f6
@@ -3104,8 +3120,7 @@ report_event(
6e16f6
 #endif /* OPENSSL */
6e16f6
 			ctl_putsys(i);
6e16f6
 		}
6e16f6
-	} else {
6e16f6
-		NTP_INSIST(peer != NULL);
6e16f6
+	} else if (NULL != peer) { /* paranoia -- skip output */
6e16f6
 		rpkt.associd = htons(peer->associd);
6e16f6
 		rpkt.status = htons(ctlpeerstatus(peer));
6e16f6