tcp_wrappers/tcp_wrappers-7.6-altformat....

34 lines
1.2 KiB
Diff

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-08-15 18:46:30.398827866 +0200
+++ tcp_wrappers_7.6-ipv6.4/hosts_access.c 2013-08-15 18:50:03.099748732 +0200
@@ -326,11 +326,15 @@ struct host_info *host;
if (cbr = strchr(tok, ']'))
*cbr = '\0';
+ if (cbr == NULL) {
+ tcpd_warn("bad IP6 address specification");
+ return (NO);
+ }
/*
* A /nnn prefix specifies how many bits of the address we
* need to check.
*/
- 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 1999-10-28 08:38:06.000000000 +0200
+++ tcp_wrappers_7.6-ipv6.4/tcpdchk.c 2013-08-15 18:46:30.399827870 +0200
@@ -430,6 +430,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);