Subversion Repositories

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

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

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