diff options
author | naddy <naddy@FreeBSD.org> | 2017-08-12 03:51:28 +0800 |
---|---|---|
committer | naddy <naddy@FreeBSD.org> | 2017-08-12 03:51:28 +0800 |
commit | 41cafca2fea8a0f4c475c5aa346e27faa58b1e9e (patch) | |
tree | 8c1f76b6bfb8f5855af9cdcec66af6bf563be7e0 | |
parent | 02718aa2f2da6a95fc1d7e9ecfcdef26a56b314b (diff) | |
download | freebsd-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/Makefile | 1 | ||||
-rw-r--r-- | net/openntpd/files/patch-src_parse.y | 23 |
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); |