From 98151bd5684bda8e796e006948d6592e0a9b7d49 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 10 Jan 2025 12:51:15 +0100 Subject: [PATCH] dnsdist: clang-tidy --- pdns/dnsdistdist/dnsdist-lua-ffi.cc | 2 ++ pdns/dnsdistdist/doh3.cc | 1 + 2 files changed, 3 insertions(+) diff --git a/pdns/dnsdistdist/dnsdist-lua-ffi.cc b/pdns/dnsdistdist/dnsdist-lua-ffi.cc index 39cd0bc9afdb..12f901acf536 100644 --- a/pdns/dnsdistdist/dnsdist-lua-ffi.cc +++ b/pdns/dnsdistdist/dnsdist-lua-ffi.cc @@ -501,6 +501,7 @@ void dnsdist_ffi_dnsquestion_set_http_response(dnsdist_ffi_dnsquestion_t* dq, ui { #if defined(HAVE_DNS_OVER_HTTPS) if (dq->dq->ids.du) { + // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic): C API PacketBuffer bodyVect(body, body + bodyLen); dq->dq->ids.du->setHTTPResponse(statusCode, std::move(bodyVect), contentType); dnsdist::PacketMangling::editDNSHeaderFromPacket(dq->dq->getMutableData(), [](dnsheader& header) { @@ -511,6 +512,7 @@ void dnsdist_ffi_dnsquestion_set_http_response(dnsdist_ffi_dnsquestion_t* dq, ui #endif #if defined(HAVE_DNS_OVER_HTTP3) if (dq->dq->ids.doh3u) { + // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic): C API PacketBuffer bodyVect(body, body + bodyLen); dq->dq->ids.doh3u->setHTTPResponse(statusCode, std::move(bodyVect), contentType); dnsdist::PacketMangling::editDNSHeaderFromPacket(dq->dq->getMutableData(), [](dnsheader& header) { diff --git a/pdns/dnsdistdist/doh3.cc b/pdns/dnsdistdist/doh3.cc index e8fc84b4968d..6ee0db58b994 100644 --- a/pdns/dnsdistdist/doh3.cc +++ b/pdns/dnsdistdist/doh3.cc @@ -315,6 +315,7 @@ static void h3_send_response(H3Connection& conn, const uint64_t streamID, uint16 addHeaderToList(headers, "content-type", sizeof("content-type") - 1, s_redirectContentType.data(), s_redirectContentType.size()); responseBody.reserve(s_redirectStart.size() + len + s_redirectEnd.size()); responseBody.insert(responseBody.begin(), s_redirectStart.begin(), s_redirectStart.end()); + // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) responseBody.insert(responseBody.end(), body, body + len); responseBody.insert(responseBody.end(), s_redirectEnd.begin(), s_redirectEnd.end()); body = responseBody.data();