]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Process review comments 12793/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 16 May 2023 10:05:07 +0000 (12:05 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 31 May 2023 09:46:16 +0000 (11:46 +0200)
pdns/recursordist/ws-recursor.cc
pdns/zonemd.cc

index 9e711c164f9cdc2696a00c46bd88ebb2df89b433..cefc6a28d8a3f595b7ae6dcae3ae12d53cf70f49 100644 (file)
@@ -154,7 +154,7 @@ static void fillZone(const DNSName& zonename, HttpResponse* resp)
 
   Json::array servers;
   for (const ComboAddress& server : zone.d_servers) {
-    servers.push_back(server.toStringWithPort()); // NOLINT: union
+    servers.push_back(server.toStringWithPort());
   }
 
   Json::array records;
@@ -202,10 +202,10 @@ static void doCreateZone(const Json& document)
     if (!singleIPTarget.empty()) {
       try {
         ComboAddress rem(singleIPTarget);
-        if (rem.sin4.sin_family != AF_INET) { // NOLINT: union
+        if (rem.sin4.sin_family != AF_INET) {
           throw ApiException("");
         }
-        singleIPTarget = rem.toString(); // NOLINT: union
+        singleIPTarget = rem.toString();
       }
       catch (...) {
         throw ApiException("Single IP target '" + singleIPTarget + "' is invalid");
@@ -238,7 +238,7 @@ static void doCreateZone(const Json& document)
         if (!serverlist.empty()) {
           serverlist += ";";
         }
-        serverlist += address.toStringWithPort(); // NOLINT: union
+        serverlist += address.toStringWithPort();
       }
       catch (const PDNSException& e) {
         throw ApiException(e.reason);
@@ -313,7 +313,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp)
     const SyncRes::AuthDomain& zone = val.second;
     Json::array servers;
     for (const ComboAddress& server : zone.d_servers) {
-      servers.push_back(server.toStringWithPort()); // NOLINT: union
+      servers.push_back(server.toStringWithPort());
     }
     // id is the canonical lookup key, which doesn't actually match the name (in some cases)
     string zoneId = apiZoneNameToId(val.first);
@@ -1358,7 +1358,7 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse* resp)
     for (const rcounts_t::value_type& count : rcounts) {
       totIncluded -= count.first;
       entries.push_back(Json::array{
-        -count.first, count.second.toString()}); // NOLINT: union
+        -count.first, count.second.toString()});
       if (tot++ >= 100) {
         break;
       }
@@ -1450,7 +1450,7 @@ void AsyncWebServer::serveConnection(const std::shared_ptr<Socket>& socket) cons
       while (!req.complete) {
         auto ret = arecvtcp(data, 16384, handler, true);
         if (ret == LWResult::Result::Success) {
-          string str(reinterpret_cast<const char*>(data.data()), data.size()); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
+          string str(reinterpret_cast<const char*>(data.data()), data.size()); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast): safe cast, data.data() returns unsigned char *
           req.complete = yarl.feed(str);
         }
         else {
index 1e5973b8a861cae7de5ca334e978f927b7b600b7..dc1ee7af252456484bce85f175dfddb7d45619b1 100644 (file)
@@ -160,7 +160,7 @@ void pdns::ZoneMD::readRecord(const DNSRecord& record)
   d_resourceRecordSetTTLs[key] = record.d_ttl;
 }
 
-void pdns::ZoneMD::verify(bool& validationDone, bool& validationOK) // NOLINT
+void pdns::ZoneMD::verify(bool& validationDone, bool& validationOK)
 {
   validationDone = false;
   validationOK = false;