From e9c6c6544dc34ed1c145b03b798f1d63f2d32283 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 15 Jan 2021 02:07:13 +0000 Subject: Do not overwrite the question when reading an answer via UDP --- src/libs6dns/s6dns_engine.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/libs6dns/s6dns_engine.c b/src/libs6dns/s6dns_engine.c index 226bdcf..a4dc8bc 100644 --- a/src/libs6dns/s6dns_engine.c +++ b/src/libs6dns/s6dns_engine.c @@ -272,12 +272,11 @@ static int s6dns_engine_read_udp (s6dns_engine_t *dt, tain_t const *stamp) memset(s6dns_ip46list_ip(&dt->servers, dt->curserver), 0, SKALIBS_IP_SIZE) ; /* do not query it again */ default : prepare_next(dt, stamp, 0) ; return 0 ; } - if (!stralloc_copyb(&dt->sa, buf, r)) + if (!stralloc_catb(&dt->sa, buf, r)) { fd_close(dt->fd) ; dt->fd = -1 ; return 0 ; } - dt->querylen = 0 ; fd_close(dt->fd) ; dt->fd = -1 ; dt->flagreading = 0 ; return 1 ; -- cgit v1.2.3