For some libc implementations, BUFSIZ is small enough (e.g. 1024 for
musl libc) to trigger compilation warnings about insufficient size of
certain buffers. Since the relevant buffers are used for printing DNS
names, increase their size to '(n + 1) * DNS_NAME_FORMATSIZE', where 'n'
is the number of DNS names which are printed to a given buffer. This
results in somewhat arbitrary, albeit nicely-aligned and large enough
buffer sizes.
static void
query_trace(query_ctx_t *qctx) {
#ifdef WANT_QUERYTRACE
- char mbuf[BUFSIZ];
+ char mbuf[2 * DNS_NAME_FORMATSIZE];
char qbuf[DNS_NAME_FORMATSIZE];
if (qctx->client->query.origqname != NULL)
dns_name_t *tname;
isc_buffer_t b;
#ifdef WANT_QUERYTRACE
- char mbuf[BUFSIZ];
+ char mbuf[4 * DNS_NAME_FORMATSIZE];
char qbuf[DNS_NAME_FORMATSIZE];
char tbuf[DNS_RDATATYPE_FORMATSIZE];
#endif