]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Prevent a copy when distributing UDP queries to workers
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 1 Aug 2023 13:09:59 +0000 (15:09 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 22 Sep 2023 08:23:46 +0000 (10:23 +0200)
Reported by Coverity as CID 1509301.

(cherry picked from commit 42d6b18e42e529a0ff89b57dca1043d6df4041ee)

pdns/recursordist/pdns_recursor.cc

index 7d24f72a23c33972cc848a82f37b90a2db8bb8a5..41de6c479f9946ebaf0f51cd526a77ab285342a2 100644 (file)
@@ -2519,7 +2519,7 @@ static void handleNewUDPQuestion(int fd, FDMultiplexer::funcparam_t& /* var */)
 
           if (RecThreadInfo::weDistributeQueries()) {
             std::string localdata = data;
-            distributeAsyncFunction(data, [localdata, fromaddr, dest, source, destination, mappedSource, tv, fd, proxyProtocolValues, eventTrace]() mutable {
+            distributeAsyncFunction(data, [localdata = std::move(localdata), fromaddr, dest, source, destination, mappedSource, tv, fd, proxyProtocolValues, eventTrace]() mutable {
               return doProcessUDPQuestion(localdata, fromaddr, dest, source, destination, mappedSource, tv, fd, proxyProtocolValues, eventTrace);
             });
           }