dnstap-read produce wrong YAML if the response is > 2048
Summary
dnstap-read produce wrong YAML if the response is > 2048
BIND version used
BIND 9.14.2 (Stable Release) <id:7a62b30>
running on Linux x86_64 3.10.0-957.12.1.el7.x86_64 #1 SMP Mon Apr 29 14:59:59 UTC 2019
built by make with '--enable-full-report' '--sysconfdir=/usr/local/etc' '--localstatedir=/var' '--without-libtool' '--with-libxml2' '--with-libjson' '--with-zlib' '--with-lmdb' '--with-libidn2' '--disable-ipv6' '--enable-dnstap' 'CFLAGS=-march=native -O2 -pipe' 'PKG_CONFIG_PATH=PKG_CONFIG_PATH:/usr/local/lib/pkgconfig'
compiled by GCC 4.8.5 20150623 (Red Hat 4.8.5-36)
compiled with OpenSSL version: OpenSSL 1.0.2k 26 Jan 2017
linked to OpenSSL version: OpenSSL 1.0.2k-fips 26 Jan 2017
compiled with libxml2 version: 2.9.1
linked to libxml2 version: 20901
compiled with libjson-c version: 0.11
linked to libjson-c version: 0.11
compiled with zlib version: 1.2.7
linked to zlib version: 1.2.7
threads support is enabled
default paths:
named configuration: /usr/local/etc/named.conf
rndc configuration: /usr/local/etc/rndc.conf
DNSSEC root key: /usr/local/etc/bind.keys
nsupdate session key: /var/run/named/session.key
named PID file: /var/run/named/named.pid
named lock file: /var/run/named/named.lock
Steps to reproduce
Using the attached file, the produced YAML file fails at line 20944
What is the current bug behavior?
The output is in part repeated and the indentation is not correct
What is the expected correct behavior?
Relevant configuration files
Relevant logs and/or screenshots
Possible fixes
file bin/tools/dnstap-read.c, line 147, function print_packet. textlen is defined as 2048.
I don't know which value can be correct. With 4096 it works. In the source file there are few other occurrences of 2048.
Edited by Michał Kępień