diff --git a/dnstap/unbound-dnstap-socket.c b/dnstap/unbound-dnstap-socket.c index 618e20fa6..1927451fe 100644 --- a/dnstap/unbound-dnstap-socket.c +++ b/dnstap/unbound-dnstap-socket.c @@ -61,6 +61,7 @@ #include "services/listen_dnsport.h" #include "sldns/sbuffer.h" #include "sldns/wire2str.h" +#include "sldns/pkthdr.h" #ifdef USE_DNSTAP #include #include "dnstap/dnstap.pb-c.h" @@ -448,6 +449,7 @@ static char* q_of_msg(ProtobufCBinaryData message) char buf[300]; /* header, name, type, class minimum to get the query tuple */ if(message.len < 12 + 1 + 4 + 4) return NULL; + if(LDNS_QDCOUNT(message.data) < 1) return NULL; if(sldns_wire2str_rrquestion_buf(message.data+12, message.len-12, buf, sizeof(buf)) != 0) { /* remove trailing newline, tabs to spaces */ diff --git a/doc/Changelog b/doc/Changelog index 4e647d4df..320803f09 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +25 May 2023: Wouter + - Fix unbound-dnstap-socket printout when no query is present. + 19 May 2023: Wouter - Fix RPZ removal of client-ip, nsip, nsdname triggers from IXFR. - Fix to remove unused variables from RPZ clientip data structure.