aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaddy <naddy@FreeBSD.org>2017-08-12 03:51:28 +0800
committernaddy <naddy@FreeBSD.org>2017-08-12 03:51:28 +0800
commit41cafca2fea8a0f4c475c5aa346e27faa58b1e9e (patch)
tree8c1f76b6bfb8f5855af9cdcec66af6bf563be7e0
parent02718aa2f2da6a95fc1d7e9ecfcdef26a56b314b (diff)
downloadfreebsd-ports-gnome-41cafca2fea8a0f4c475c5aa346e27faa58b1e9e.tar.gz
freebsd-ports-gnome-41cafca2fea8a0f4c475c5aa346e27faa58b1e9e.tar.zst
freebsd-ports-gnome-41cafca2fea8a0f4c475c5aa346e27faa58b1e9e.zip
Add a missing initialization and correct a memcpy size to fix the new
"query from" feature. Reported by: Roger Marquis <marquis@roble.com>
-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);