From 25d7e1ed6176424cef8e0bbbf2110e8fc5d914e0 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 30 Jul 2025 16:08:26 +0200 Subject: [PATCH] Process review comments from Miod Signed-off-by: Otto Moerbeek --- pdns/recursordist/rec_channel.cc | 8 ++++---- pdns/recursordist/rec_channel_rec.cc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pdns/recursordist/rec_channel.cc b/pdns/recursordist/rec_channel.cc index 3157dbd93c..33f609129b 100644 --- a/pdns/recursordist/rec_channel.cc +++ b/pdns/recursordist/rec_channel.cc @@ -61,7 +61,7 @@ RecursorControlChannel::~RecursorControlChannel() close(d_fd); } if (d_local.sun_path[0] != '\0') { - unlink(d_local.sun_path); // NOLINT + unlink(d_local.sun_path); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay) } } @@ -149,8 +149,8 @@ static void sendfd(int socket, int fd_to_pass) io_vector[0].iov_len = 1; memset(&msg, 0, sizeof(msg)); - msg.msg_control = &cmsgbuf.buf; - msg.msg_controllen = sizeof(cmsgbuf.buf); + msg.msg_control = cmsgbuf.buf.data(); + msg.msg_controllen = cmsgbuf.buf.size(); msg.msg_iov = io_vector.data(); msg.msg_iovlen = io_vector.size(); @@ -253,7 +253,7 @@ RecursorControlChannel::Answer RecursorControlChannel::recv(int fileDesc, unsign while (str.length() < len) { std::array buffer{}; waitForRead(fileDesc, timeout, start); - size_t toRead = std::min(len - str.length(), sizeof(buffer)); + size_t toRead = std::min(len - str.length(), buffer.size()); ssize_t recvd = ::recv(fileDesc, buffer.data(), toRead, 0); if (recvd <= 0) { // EOF means we have a length error diff --git a/pdns/recursordist/rec_channel_rec.cc b/pdns/recursordist/rec_channel_rec.cc index c3274a0fee..5a65eae9ca 100644 --- a/pdns/recursordist/rec_channel_rec.cc +++ b/pdns/recursordist/rec_channel_rec.cc @@ -332,8 +332,8 @@ getfd(int socket) io_vector[0].iov_len = 1; memset(&msg, 0, sizeof(msg)); - msg.msg_control = &cmsgbuf.buf; - msg.msg_controllen = sizeof(cmsgbuf.buf); + msg.msg_control = cmsgbuf.buf.data(); + msg.msg_controllen = cmsgbuf.buf.size(); msg.msg_iov = io_vector.data(); msg.msg_iovlen = io_vector.size(); -- 2.47.3