Package: mimedefang
Version: 3.3-1

Hi,

relay_is_blacklisted_multi sends out its multiple DNS requests at once,
and then uses IO::Select to wait for the various answers as they come in.

It has a loop in which it intends to remove each socket from the
IO::Select set as soon as it is done with it (i.e. received and
processed the answer).

However, it accidentally removes the wrong socket: $sock instead of $rsock.

$sock is a now useless variable from a previous loop (should have been
"my" to that loop), which just happens to be the highest socket of the set.

The result of this issue is that that last socket is dropped from the
set, even if it hasn't received an answer, meaning that if this socket
isn't the first one to receive an answer, its answer will never be
processed, resulting in a SERVFAIL on that query.

Here is a patch:

--- ./usr/share/perl5/Mail/MIMEDefang/Net.pm    2023-01-30
18:00:55.000000000 +0100
+++ /usr/share/perl5/Mail/MIMEDefang/Net.pm     2023-11-20
11:54:23.448414007 +0100
@@ -386,7 +386,7 @@
     @ready = $sel->can_read($expire);
     foreach my $rsock (@ready) {
       my $pack = $res->bgread($rsock);
-      $sel->remove($sock);
+      $sel->remove($rsock);
       my $sdomain = $sock_to_domain{$rsock};
       undef($rsock);
       my($rr, $rcode);


Btw, this issue no longer exists in the most recent upstream version

Thanks,

Alain

Reply via email to