]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix unbound-dnstap-socket printout when no query is present.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 25 May 2023 12:30:25 +0000 (14:30 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 25 May 2023 12:30:25 +0000 (14:30 +0200)
dnstap/unbound-dnstap-socket.c
doc/Changelog

index 618e20fa647111ef0c99cfe3241c98144863782f..1927451fe9f2df0db7778f6066342095a49eb16f 100644 (file)
@@ -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 <protobuf-c/protobuf-c.h>
 #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 */
index 4e647d4df3553f4aaf22b598c52ce861090c5821..320803f093de019bdb912dd13c813c7267b39a03 100644 (file)
@@ -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.