Skip to content

Commit

Permalink
Check $addr is defined before using it
Browse files Browse the repository at this point in the history
Prevent the following error if we receive an invalid RCPT TO (eg <"relaytest%nmap.scanme.org">)

Can't call method "qp" on an undefined value at /usr/share/perl5/vendor_perl/Qpsmtpd.pm line 451.
/usr/bin/qpsmtpd-forkserver[17472]: command 'rcpt' failed unexpectedly
  • Loading branch information
Daniel Berteaud committed May 15, 2016
1 parent f8c6614 commit bbfd691
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Qpsmtpd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ sub auth_mechanism {
sub address {
my $self = shift;
my $addr = Qpsmtpd::Address->new(@_);
$addr->qp($self);
$addr->qp($self) if $addr;
return $addr;
}

Expand Down

0 comments on commit bbfd691

Please sign in to comment.