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

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