From: Otto Moerbeek Date: Wed, 30 Jul 2025 14:08:26 +0000 (+0200) Subject: Process review comments from Miod X-Git-Tag: auth-5.1.0-alpha0~3^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25d7e1ed6176424cef8e0bbbf2110e8fc5d914e0;p=thirdparty%2Fpdns.git Process review comments from Miod Signed-off-by: Otto Moerbeek --- diff --git a/pdns/recursordist/rec_channel.cc b/pdns/recursordist/rec_channel.cc index 3157dbd93..33f609129 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 c3274a0fe..5a65eae9c 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();