]> source.dussan.org Git - rspamd.git/commitdiff
Fix using of $1 and $2 in Mail::Rspamd::Client (reported by Andrej Zverev)
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 29 Oct 2010 14:46:48 +0000 (18:46 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 29 Oct 2010 14:46:48 +0000 (18:46 +0400)
perl/lib/Mail/Rspamd/Client.pm

index 6cc316b2fc8998e8d62d2c6ec1ef3644d87be7d3..d98afc8b424f8e7e3f318c8e008014bd0949c1a5 100644 (file)
@@ -616,11 +616,12 @@ sub _create_connection {
                }
     }
     elsif ($hostdef =~ /^\s*(([^:]+):(\d+))\s*$/) {
+               my $peer_addr = $2;
                if ($2 eq '*') {
-                       $2 = '127.0.0.1';       
+                       $peer_addr = '127.0.0.1';       
                }
                $remote = IO::Socket::INET->new( Proto     => "tcp",
-                                       PeerAddr  => $2,
+                                       PeerAddr  => $peer_addr,
                                        PeerPort  => $3,
                                        Blocking  => 0,
                                );
@@ -636,11 +637,12 @@ sub _create_connection {
                }
     }
     elsif ($hostdef =~ /^\s*([^:]+)\s*$/) {
+               my $peer_addr = $1;
                if ($1 eq '*') {
-                       $1 = '127.0.0.1';       
+                       $peer_addr = '127.0.0.1';       
                }
                $remote = IO::Socket::INET->new( Proto     => "tcp",
-                                       PeerAddr  => $1,
+                                       PeerAddr  => $peer_addr,
                                        PeerPort  => $self->{control} ? 11334 : 11333,
                                        Blocking  => 0,
                                );