diff --git a/CHANGES b/CHANGES index a777a0500e..d2a0f65f6e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5722. [bug] Preserve the contents of TCPDNS and TLSDNS receive + buffer when growing the buffer size. [GL #2917] + 5721. [func] New isc_mem_reget() realloc-like function was introduced into the libisc API, and zero-sized allocations now return non-NULL pointers. [GL !5440] diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index cfa98cedde..46c66f04ad 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -62,3 +62,6 @@ Bug Fixes - When new IP addresses were added to the system during ``named`` startup, ``named`` failed to listen on TCP for the newly added interfaces. :gl:`#2852` + +- Under specific circumstances, zone transfers over TCP and TLS could be + interrupted prematurely. This has been fixed. :gl:`#2917` diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 5b1ff7cdb8..a74047d763 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -1894,8 +1894,8 @@ isc__nm_alloc_dnsbuf(isc_nmsocket_t *sock, size_t len) { sock->buf_size = alloc_len; } else { /* We have the buffer but it's too small */ - isc_mem_put(sock->mgr->mctx, sock->buf, sock->buf_size); - sock->buf = isc_mem_get(sock->mgr->mctx, NM_BIG_BUF); + sock->buf = isc_mem_reget(sock->mgr->mctx, sock->buf, + sock->buf_size, NM_BIG_BUF); sock->buf_size = NM_BIG_BUF; } }