spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quin...@apache.org
Subject svn commit: rev 46955 - spamassassin/trunk/lib/Mail/SpamAssassin
Date Tue, 21 Sep 2004 03:15:00 GMT
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

Mime
View raw message