diff --git a/CHANGES b/CHANGES index 88f68c6304..a600b3a66c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,14 @@ +4.1.0-dev.266 | 2021-02-25 08:45:49 -0700 + + * Avoid superfluous string copies when adding to zeek::detail::sig_files + + Coverity 1387015 (Jon Siwek, Corelight) + + * Initialize an RD_Decorate member via std::move (Jon Siwek, Corelight) + + * Fix invalid iterator comparison in UseDefs::FindSuccUsage() + + Coverity 1447018 (Jon Siwek, Corelight) 4.1.0-dev.260 | 2021-02-24 15:52:31 -0800 diff --git a/VERSION b/VERSION index 772ef5ce0a..66d4a27af3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.0-dev.260 +4.1.0-dev.266 diff --git a/src/scan.l b/src/scan.l index 198843fe83..5052e7583c 100644 --- a/src/scan.l +++ b/src/scan.l @@ -357,7 +357,7 @@ when return TOK_WHEN; zeek::reporter->Error("failed to find file associated with @load-sigs %s", file); else - zeek::detail::sig_files.push_back(zeek::util::copy_string(path.c_str())); + zeek::detail::sig_files.push_back(std::move(path)); break; case 0: diff --git a/src/script_opt/GenRDs.h b/src/script_opt/GenRDs.h index 3d3536bad6..38202cbb6c 100644 --- a/src/script_opt/GenRDs.h +++ b/src/script_opt/GenRDs.h @@ -50,7 +50,7 @@ private: class RD_Decorate : public TraversalCallback { public: - RD_Decorate(std::shared_ptr _pf) : pf(_pf) + RD_Decorate(std::shared_ptr _pf) : pf(std::move(_pf)) { } // Traverses the given function body, using the first two diff --git a/src/script_opt/UseDefs.cc b/src/script_opt/UseDefs.cc index ffef5bae43..f8476e5d68 100644 --- a/src/script_opt/UseDefs.cc +++ b/src/script_opt/UseDefs.cc @@ -444,7 +444,7 @@ UDs UseDefs::FindSuccUsage(const Stmt* s) const auto uds = no_succ ? nullptr : FindUsage(succ->second); auto succ2 = successor2.find(s); - auto no_succ2 = (succ2 == successor.end() || ! succ2->second); + auto no_succ2 = (succ2 == successor2.end() || ! succ2->second); auto uds2 = no_succ2 ? nullptr : FindUsage(succ2->second); if ( uds && uds2 )