From: Remi Gacogne Date: Thu, 11 May 2023 13:27:07 +0000 (+0200) Subject: dnsdist: Properly set the size of the UDP health-check response X-Git-Tag: rec-5.0.0-alpha1~177^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12804%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Properly set the size of the UDP health-check response We forgot to resize the response buffer to what we actually got, so the initial buffer size (512) was mistakenly used later on. Technically this should not be an issue as the buffer is large enough, but that prevents us from reporting that the response was broken if it not large enough for a DNS header, for example. --- diff --git a/pdns/dnsdistdist/dnsdist-healthchecks.cc b/pdns/dnsdistdist/dnsdist-healthchecks.cc index 1addf7583d..631f9ef949 100644 --- a/pdns/dnsdistdist/dnsdist-healthchecks.cc +++ b/pdns/dnsdistdist/dnsdist-healthchecks.cc @@ -177,6 +177,7 @@ static void healthCheckUDPCallback(int fd, FDMultiplexer::funcparam_t& param) data->d_ds->submitHealthCheckResult(data->d_initial, false); return; } + data->d_buffer.resize(static_cast(got)); /* we are using a connected socket but hey.. */ if (from != data->d_ds->d_config.remote) {