]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Properly set the size of the UDP health-check response 12804/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 11 May 2023 13:27:07 +0000 (15:27 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 11 May 2023 13:27:07 +0000 (15:27 +0200)
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.

pdns/dnsdistdist/dnsdist-healthchecks.cc

index 1addf7583de3a5f83a36a3ff3199cb46a79decc8..631f9ef9493f1228b78f2817856cddc01b633128 100644 (file)
@@ -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<size_t>(got));
 
   /* we are using a connected socket but hey.. */
   if (from != data->d_ds->d_config.remote) {