Blame SOURCES/ntp-4.2.6p5-cve-2017-6463.patch

edcb74
2017-02-12 11:08:16+01:00, perlinger@ntp.org
edcb74
  [Sec 3387] NTP-01-012: Authenticated DoS via Malicious Config Option
edcb74
edcb74
diff -up ntp-4.2.6p5/ntpd/ntp_config.c.cve-2017-6463 ntp-4.2.6p5/ntpd/ntp_config.c
edcb74
--- ntp-4.2.6p5/ntpd/ntp_config.c.cve-2017-6463	2017-03-22 14:28:51.342870650 +0100
edcb74
+++ ntp-4.2.6p5/ntpd/ntp_config.c	2017-03-22 15:20:44.970380429 +0100
edcb74
@@ -1264,7 +1264,8 @@ destroy_address_node(
edcb74
 	struct address_node *my_node
edcb74
 	)
edcb74
 {
edcb74
-	NTP_REQUIRE(NULL != my_node);
edcb74
+	if (NULL == my_node)
edcb74
+		return;
edcb74
 	NTP_REQUIRE(NULL != my_node->address);
edcb74
 
edcb74
 	free(my_node->address);
edcb74
@@ -3563,10 +3564,10 @@ config_unpeers(
edcb74
 	     curr_unpeer = next_node(curr_unpeer)) {
edcb74
 
edcb74
 		/*
edcb74
-		 * Either AssocID will be zero, and we unpeer by name/
edcb74
-		 * address addr, or it is nonzero and addr NULL.
edcb74
+		 * If we have no address attached, assume we have to
edcb74
+		 * unpeer by AssocID.
edcb74
 		 */
edcb74
-		if (curr_unpeer->assocID) {
edcb74
+		if (!curr_unpeer->addr) {
edcb74
 			peer = findpeerbyassoc((u_int)curr_unpeer->assocID);
edcb74
 			if (peer != NULL) {
edcb74
 				peer_clear(peer, "GONE");