aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@FreeBSD.org>2017-08-11 19:51:28 +0000
committerChristian Weisgerber <naddy@FreeBSD.org>2017-08-11 19:51:28 +0000
commit314ed8e624772fab75ec5f7e4151ad8b502c16ea (patch)
tree8c1f76b6bfb8f5855af9cdcec66af6bf563be7e0 /net
parentcba2760d64c7979c20d60e27aa0078426cc12b67 (diff)
downloadports-314ed8e624772fab75ec5f7e4151ad8b502c16ea.tar.gz
ports-314ed8e624772fab75ec5f7e4151ad8b502c16ea.zip
Add a missing initialization and correct a memcpy size to fix the new
"query from" feature. Reported by: Roger Marquis <marquis@roble.com>
Notes
Notes: svn path=/head/; revision=447789
Diffstat (limited to 'net')
-rw-r--r--net/openntpd/Makefile1
-rw-r--r--net/openntpd/files/patch-src_parse.y23
2 files changed, 24 insertions, 0 deletions
diff --git a/net/openntpd/Makefile b/net/openntpd/Makefile
index cb7cf2644bb1..fc01766f601a 100644
--- a/net/openntpd/Makefile
+++ b/net/openntpd/Makefile
@@ -2,6 +2,7 @@
PORTNAME= openntpd
PORTVERSION= 6.2p1
+PORTREVISION= 1
PORTEPOCH= 2
CATEGORIES= net
MASTER_SITES= OPENBSD/OpenNTPD
diff --git a/net/openntpd/files/patch-src_parse.y b/net/openntpd/files/patch-src_parse.y
new file mode 100644
index 000000000000..0f1a3b912131
--- /dev/null
+++ b/net/openntpd/files/patch-src_parse.y
@@ -0,0 +1,23 @@
+--- src/parse.y.orig 2017-08-11 19:19:57 UTC
++++ src/parse.y
+@@ -136,6 +136,8 @@ main : LISTEN ON address listen_opts {
+ struct sockaddr_in sin4;
+ struct sockaddr_in6 sin6;
+
++ memset(&sin4, 0, sizeof(sin4));
++ memset(&sin6, 0, sizeof(sin6));
+ sin4.sin_family = AF_INET;
+ sin6.sin6_family = AF_INET6;
+ #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+@@ -144,9 +146,9 @@ main : LISTEN ON address listen_opts {
+ #endif
+
+ if (inet_pton(AF_INET, $3, &sin4.sin_addr) == 1)
+- memcpy(&query_addr4, &sin4, sizeof(struct in_addr));
++ memcpy(&query_addr4, &sin4, sizeof(struct sockaddr_in));
+ else if (inet_pton(AF_INET6, $3, &sin6.sin6_addr) == 1)
+- memcpy(&query_addr6, &sin6, sizeof(struct in6_addr));
++ memcpy(&query_addr6, &sin6, sizeof(struct sockaddr_in6));
+ else {
+ yyerror("invalid IPv4 or IPv6 address: %s\n",
+ $3);