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

(cherry picked from commit 6a04912e36e32104434d2b1b0625a0de0e0c002d)

pdns/dnsdistdist/dnsdist-healthchecks.cc

index 4a5205227626e605de8776a10bc7cdc7b78449c0..1c3729ac7fc4df2f4c5367af8af2b30255b5f513 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) {