]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: don't increment in a potential macro argument 16042/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 28 Aug 2025 07:53:53 +0000 (09:53 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 28 Aug 2025 07:53:53 +0000 (09:53 +0200)
Fixes g++ 8: ../dnsdist-crypto.cc:291:16: warning: operation on 'count' may be undefined [-Wsequence-point]

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/dnsdistdist/dnsdist-crypto.cc

index c31727b4ae2b10f9c609e545c187189866a0f275..c864ac8c2ab1b6b111587065098223774bdf9a02 100644 (file)
@@ -287,8 +287,8 @@ void Nonce::increment()
 {
   // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
   auto* ptr = reinterpret_cast<uint32_t*>(value.data());
-  uint32_t count = htonl(*ptr);
-  *ptr = ntohl(++count);
+  uint32_t count = htonl(*ptr) + 1;
+  *ptr = ntohl(count);
 }
 
 #else