summaryrefslogtreecommitdiff
path: root/net/ntp4/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'net/ntp4/patches/patch-aa')
-rw-r--r--net/ntp4/patches/patch-aa29
1 files changed, 29 insertions, 0 deletions
diff --git a/net/ntp4/patches/patch-aa b/net/ntp4/patches/patch-aa
new file mode 100644
index 00000000000..b561b273854
--- /dev/null
+++ b/net/ntp4/patches/patch-aa
@@ -0,0 +1,29 @@
+$NetBSD: patch-aa,v 1.3 2001/04/06 15:21:06 fredb Exp $
+
+--- ntpd/ntp_control.c 2000/04/22 14:53:15 1.1.1.2
++++ ntpd/ntp_control.c 2001/04/05 09:45:27 1.1.1.2.4.1
+@@ -1812,9 +1812,22 @@
+ while (cp < reqend &&
+ isspace((int)*cp))
+ cp++;
+- while (cp < reqend && *cp !=
+- ',')
++ while (cp < reqend && *cp != ',') {
+ *tp++ = *cp++;
++ if (tp >=
++ buf + sizeof(buf) - 1) {
++#if 0 /* don't syslog for now - DoS potential on filling syslog */
++ msyslog(LOG_WARNING,
++ "Attempted \"ntpdx\" exploit from IP %d.%d.%d.%d:%d (possibly spoofed)\n",
++ (ntohl(rmt_addr->sin_addr.s_addr) >> 24) & 0xff,
++ (ntohl(rmt_addr->sin_addr.s_addr) >> 16) & 0xff,
++ (ntohl(rmt_addr->sin_addr.s_addr) >> 8) & 0xff,
++ (ntohl(rmt_addr->sin_addr.s_addr) >> 0) & 0xff,
++ ntohs(rmt_addr->sin_port));
++#endif
++ return (0);
++ }
++ }
+ if (cp < reqend)
+ cp++;
+ *tp = '\0';