]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Prevent a warning about pointer arithmetic use 13347/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 10 Oct 2023 08:32:03 +0000 (10:32 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 10 Oct 2023 08:32:03 +0000 (10:32 +0200)
pdns/dnsdist.cc

index 8ceb242346feedf8d237c066b4b8383c09e9b2f6..8e2eee70c186672f48223b6989eb519355acb1d7 100644 (file)
@@ -1572,7 +1572,7 @@ bool assignOutgoingUDPQueryToBackend(std::shared_ptr<DownstreamState>& ds, uint1
     auto proxyProtocolPayloadSize = dq.ids.d_proxyProtocolPayloadSize;
     auto idOffset = ds->saveState(std::move(dq.ids));
     /* set the correct ID */
-    memcpy(query.data() + proxyProtocolPayloadSize, &idOffset, sizeof(idOffset));
+    memcpy(&query.at(proxyProtocolPayloadSize), &idOffset, sizeof(idOffset));
 
     /* you can't touch ids or du after this line, unless the call returned a non-negative value,
        because it might already have been freed */