/[Apache-SVN]/spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm
ViewVC logotype

Diff of /spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm	2005/07/09 01:27:45	209916
+++ spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm	2005/07/09 01:30:33	209917
@@ -225,7 +225,17 @@ sub _packet_id {
   my $id = $header->id;
   my @questions = $packet->question;
   my $ques = $questions[0];
-  return $id . $ques->qname . $ques->qtype . $ques->qclass;
+
+  if (defined $ques) {
+    return $id . $ques->qname . $ques->qtype . $ques->qclass;
+  } else {
+    # odd.  this should not happen, but clearly some DNS servers
+    # can return something that Net::DNS interprets as having no
+    # question section.  Better support it; just return the
+    # (safe) ID part, along with a text token indicating that
+    # the packet had no question part.
+    return $id . "NO_QUESTION_IN_PACKET";
+  }
 }
 
 ###########################################################################

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26