mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-01 14:55:10 +00:00
parser: fix coverity issues found in snapshot 70858
This commit add fixes for issues found in coverity's snapshot 70858. - CID 323127: Performance inefficiencies (COPY_INSTEAD_OF_MOVE) - CID 323125: Uninitialized members (UNINIT_CTOR) I'm also removing Novell, Inc. from the copyright notice added by a copy-paste error, and an unused variable left over from debugging. Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
@@ -882,7 +882,7 @@ static std::string generate_regex_range(bignum start, bignum end)
|
||||
std::ostringstream result;
|
||||
std::vector<std::pair<bignum, bignum>> regex_range;
|
||||
int j;
|
||||
regex_range = regex_range_generator(start, end);
|
||||
regex_range = regex_range_generator(std::move(start), std::move(end));
|
||||
for (auto &i: regex_range) {
|
||||
bignum sstart = i.first;
|
||||
bignum send = i.second;
|
||||
@@ -942,7 +942,7 @@ int convert_range(std::string& buffer, bignum start, bignum end)
|
||||
pattern_t ptype;
|
||||
int pos;
|
||||
|
||||
std::string regex_range = generate_regex_range(start, end);
|
||||
std::string regex_range = generate_regex_range(std::move(start), std::move(end));
|
||||
|
||||
if (!regex_range.empty()) {
|
||||
ptype = convert_aaregex_to_pcre(regex_range.c_str(), 0, glob_default, buffer, &pos);
|
||||
|
Reference in New Issue
Block a user