Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 78 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
53 magnus 1
#! /bin/sh /usr/share/dpatch/dpatch-run
78 magnus 2
## ipv6_buffer_miscalculation.dpatch by Matthias Scheler <tron@netbsd.org> and others
53 magnus 3
##
78 magnus 4
## DP: Fix various IPv6-related typos, C&P bugs etc.
5
## DP: These can crash applications using libspf2 or give the wrong result if
6
## DP: an e-mail gets delivered via SMTP over IPv6 depending on the remote
7
## DP: machine's IPv6 address.
53 magnus 8
 
9
@DPATCH@
10
--- a/src/libspf2/spf_expand.c	2008-11-03 21:29:00.000000000 +0000
11
+++ b/src/libspf2/spf_expand.c	2009-09-08 11:27:52.000000000 +0100
12
@@ -245,7 +245,7 @@
13
 		case PARM_CLIENT_IP:		/* SMTP client IP				*/
14
 #ifdef COMPUTE
15
 			if (compute_length) {
16
-				len = sizeof(ip6_buf);
17
+				len = sizeof(ip6_rbuf);
18
 				if (d->dv.url_encode)
19
 					len *= 3;
20
 				buflen += len;
78 magnus 21
--- a/src/libspf2/spf_interpret.c	2008-10-22 11:47:43.000000000 -0400
22
+++ b/src/libspf2/spf_interpret.c	2009-09-08 00:42:25.000000000 -0400
23
@@ -505,7 +505,7 @@
24
 	char		dst_ip6_buf[ INET6_ADDRSTRLEN ];
25
 
26
 	struct in6_addr		src_ipv6;
27
-	int				cidr, mask;
28
+	int				cidr, cidr_save, mask;
29
 	int				i;
30
 	int				match;
31
 
32
@@ -517,6 +517,7 @@
33
 	cidr = SPF_i_mech_cidr(spf_request, mech);
34
 	if ( cidr == 0 )
35
 		cidr = 128;
36
+	cidr_save = cidr;
37
 
38
 	match = TRUE;
39
 	for( i = 0; i < array_elem( ipv6.s6_addr ) && match; i++ )
40
@@ -538,7 +539,7 @@
41
 		INET_NTOP(AF_INET6, &ipv6.s6_addr,
42
 							dst_ip6_buf, sizeof(dst_ip6_buf));
43
 		SPF_debugf( "ip_match:  %s == %s  (/%d):  %d",
44
-				src_ip6_buf, dst_ip6_buf, cidr, match );
45
+				src_ip6_buf, dst_ip6_buf, cidr_save, match );
46
 	}
47
 
48
 	return match;
49
--- a/src/libspf2/spf_compile.c	2008-11-03 15:37:33.000000000 -0500
50
+++ b/src/libspf2/spf_compile.c	2009-09-07 23:46:02.000000000 -0400
51
@@ -778,7 +778,7 @@
52
 	const char			*end;
53
 	const char			*p;
54
 
55
-	char				 buf[ INET_ADDRSTRLEN ];
56
+	char				 buf[ INET6_ADDRSTRLEN ];
57
 	size_t				 len;
58
 	int					 err;
59