File amavisd-new-bug1012969.diff of Package amavisd-new.openSUSE_Leap_42.2_Update

diff --git a/amavisd b/amavisd
index 159e680..b0bf095 100755
--- a/amavisd
+++ b/amavisd
@@ -5604,7 +5604,7 @@ sub ip_to_vec($;$) {
     my(@d) = ($2,$3,$4,$5);
     !grep($_ > 255, @d)
       or die "Invalid decimal field value in IPv6 address: [$ip]\n";
-    $ipa = $2 . sprintf('%02x%02x:%02x%02x', @d);
+    $ipa = $1 . sprintf('%02x%02x:%02x%02x', @d);
   } elsif (!$have_ipv6 &&
            $ipa =~ m{^ \d{1,3} (?: \. \d{1,3}){0,3} \z}xs) {  # IPv4
     my(@d) = split(/\./,$ipa,-1);
@@ -5642,7 +5642,7 @@ sub ip_to_vec($;$) {
   }
   @ip_fields >= 8  or die "IPv6 address [$ip] contains fewer than 8 fields\n";
   @ip_fields <= 8  or die "IPv6 address [$ip] contains more than 8 fields\n";
-  !grep(!/^[0-9a-zA-Z]{1,4}\z/, @ip_fields)  # this is quite slow
+  !grep(!/^[0-9a-fA-F]{1,4}\z/, @ip_fields)  # this is quite slow
     or die "Invalid syntax of IPv6 address: [$ip]\n";
   my $vec = pack('n8', map(hex($_),@ip_fields));
   if (!defined($ip_len)) {
openSUSE Build Service is sponsored by