From: Remi Gacogne Date: Tue, 1 Aug 2023 13:09:59 +0000 (+0200) Subject: rec: Prevent a copy when distributing UDP queries to workers X-Git-Tag: rec-4.9.2~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ac3aabf27db4fbe2bf4ae61cd839d8546e06252;p=thirdparty%2Fpdns.git rec: Prevent a copy when distributing UDP queries to workers Reported by Coverity as CID 1509301. (cherry picked from commit 42d6b18e42e529a0ff89b57dca1043d6df4041ee) --- diff --git a/pdns/recursordist/pdns_recursor.cc b/pdns/recursordist/pdns_recursor.cc index 7d24f72a23..41de6c479f 100644 --- a/pdns/recursordist/pdns_recursor.cc +++ b/pdns/recursordist/pdns_recursor.cc @@ -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); }); }