Skip to content

Commit

Permalink
dnsdist: Explain to clang-tidy that resizing a moved vector is fine
Browse files Browse the repository at this point in the history
(cherry picked from commit c0391c2)
  • Loading branch information
rgacogne committed Dec 12, 2023
1 parent 5def25e commit 52e0c82
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pdns/dnsdist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ void responderThread(std::shared_ptr<DownstreamState> dss)

for (const auto& fd : sockets) {
/* allocate one more byte so we can detect truncation */
// NOLINTNEXTLINE(bugprone-use-after-move): resizing a vector has no preconditions so it is valid to do so after moving it
response.resize(initialBufferSize + 1);
ssize_t got = recv(fd, response.data(), response.size(), 0);

Expand Down

0 comments on commit 52e0c82

Please sign in to comment.