tcp_wrappers/tcp_wrappers-7.6-altformat.patch

35 lines
1.2 KiB
Diff
Raw Normal View History

2013-01-28 12:51:32 +00:00
diff -up tcp_wrappers_7.6-ipv6.4/hosts_access.c.altformat tcp_wrappers_7.6-ipv6.4/hosts_access.c
--- tcp_wrappers_7.6-ipv6.4/hosts_access.c.altformat 2013-07-09 10:27:20.796653076 +0200
+++ tcp_wrappers_7.6-ipv6.4/hosts_access.c 2013-07-09 14:11:52.014295459 +0200
@@ -331,11 +331,16 @@ struct host_info *host;
if ((cbr = strchr(tok, ']')))
*cbr = '\0';
2013-01-28 12:51:32 +00:00
+ if (cbr == NULL) {
+ tcpd_warn("bad IP6 address specification");
+ return (NO);
+ }
+
2013-01-28 12:51:32 +00:00
/*
* A /nnn prefix specifies how many bits of the address we
* need to check.
2013-01-28 12:51:32 +00:00
*/
- if ((slash = strchr(tok, '/'))) {
+ if ((slash = strchr(tok, '/')) || (slash = strchr(cbr+1, '/'))) {
*slash = '\0';
mask = atoi(slash+1);
if (mask < 0 || mask > IPV6_ABITS) {
diff -up tcp_wrappers_7.6-ipv6.4/tcpdchk.c.altformat tcp_wrappers_7.6-ipv6.4/tcpdchk.c
--- tcp_wrappers_7.6-ipv6.4/tcpdchk.c.altformat 2013-07-09 10:27:20.793653089 +0200
+++ tcp_wrappers_7.6-ipv6.4/tcpdchk.c 2013-07-09 10:27:20.798653068 +0200
2013-01-28 12:51:32 +00:00
@@ -434,6 +434,9 @@ char *pat;
int err = 0;
int mask = IPV6_ABITS;
+ if (!slash)
+ slash = strchr(cbr+1, '/');
+
if (slash != NULL) {
*slash = '\0';
mask = atoi(slash + 1);