From eac815c8914e12640430caf6e6b1b495c24404ad Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 29 Oct 2010 18:46:48 +0400 Subject: [PATCH] Fix using of $1 and $2 in Mail::Rspamd::Client (reported by Andrej Zverev) --- perl/lib/Mail/Rspamd/Client.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/perl/lib/Mail/Rspamd/Client.pm b/perl/lib/Mail/Rspamd/Client.pm index 6cc316b2f..d98afc8b4 100644 --- a/perl/lib/Mail/Rspamd/Client.pm +++ b/perl/lib/Mail/Rspamd/Client.pm @@ -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, ); -- 2.39.5