diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-01-15 02:07:13 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2021-01-15 02:07:13 +0000 |
commit | e9c6c6544dc34ed1c145b03b798f1d63f2d32283 (patch) | |
tree | 12a76323ee24977c774a66f2b3fcdbfd18214bfe /src | |
parent | f3d8514681a6a9a0664d3ad0b6b72eb87346f92f (diff) | |
download | s6-dns-e9c6c6544dc34ed1c145b03b798f1d63f2d32283.tar.xz |
Do not overwrite the question when reading an answer via UDP
Diffstat (limited to 'src')
-rw-r--r-- | src/libs6dns/s6dns_engine.c | 3 |
1 files changed, 1 insertions, 2 deletions
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 ; |