]> granicus.if.org Git - pdns/commitdiff
we would attempt to protobuf log DNS questions without a set question and get excepti...
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 11 May 2017 15:16:20 +0000 (17:16 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Sat, 13 May 2017 07:57:13 +0000 (09:57 +0200)
(cherry picked from commit da5bcd9d891418b9462c76fbc87fd7e18fa374c8)

pdns/protobuf.cc

index 2dfd930100b5c05cd0bc40c4fe28e43d85c687dd..523b526cc26e5c4833c470ba3a54e8416f3ec905 100644 (file)
@@ -37,7 +37,8 @@ void DNSProtoBufMessage::setQuestion(const DNSName& qname, uint16_t qtype, uint1
 #ifdef HAVE_PROTOBUF
   PBDNSMessage_DNSQuestion* question = d_message.mutable_question();
   if (question) {
-    question->set_qname(qname.toString());
+    if(!qname.empty())
+      question->set_qname(qname.toString());
     question->set_qtype(qtype);
     question->set_qclass(qclass);
   }