You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by qu...@apache.org on 2004/09/21 05:15:00 UTC
svn commit: rev 46955 - spamassassin/trunk/lib/Mail/SpamAssassin
Author: quinlan
Date: Mon Sep 20 20:14:59 2004
New Revision: 46955
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Dns.pm
Log:
bug 3794: add some defined() checks for incomplete DNS responses
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Dns.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Dns.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Dns.pm Mon Sep 20 20:14:59 2004
@@ -182,10 +182,13 @@
my $packet = $self->{res}->bgread($query->[BGSOCK]);
undef $query->[BGSOCK];
-
- return if !defined $packet;
+ return unless (defined $packet &&
+ defined $packet->header &&
+ defined $packet->question &&
+ defined $packet->answer);
my $question = ($packet->question)[0];
+ return if !defined $question;
# NO_DNS_FOR_FROM
if ($self->{sender_host} &&
@@ -200,6 +203,7 @@
}
# DNSBL tests are here
foreach my $answer ($packet->answer) {
+ next if !defined $answer;
# track all responses
$self->dnsbl_uri($question, $answer);
# TODO: there are some CNAME returns that might be useful