Fix static analysis issues 35/308235/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Wed, 20 Mar 2024 05:55:33 +0000 (14:55 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Wed, 20 Mar 2024 05:55:33 +0000 (14:55 +0900)
Change-Id: Id2c82cf60202e21da11a880e0fdcd4f1cbaa00a1
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/common/certificate_validation.cc
src/common/signature.cc
src/common/step/step.h

index 4975f96..0d7b924 100644 (file)
@@ -66,7 +66,7 @@ static bool SetAuthorCertificate(const ValidationCore::SignatureData& data,
   (*it)->getPublicKeyDER(&public_key, &len);
   std::string author_id =
       ci::EncodeBase64(public_key, len);
-  cert_info->author_id.set(author_id);
+  cert_info->author_id.set(std::move(author_id));
   free(public_key);
 
   return SetCertificate(data,
index 1e1f661..2e3301e 100644 (file)
@@ -61,7 +61,8 @@ bool Signature::GetPrivilegeLevel(std::filesystem::path sig_root_path,
       request_type_ == ci::RequestType::ManifestPartialInstall ||
       request_type_ == ci::RequestType::ManifestPartialUpdate)))
     check_reference = false;
-  if (!CheckSignatures(check_reference, level, sig_root_path, error_message))
+  if (!CheckSignatures(check_reference, level, std::move(sig_root_path),
+      error_message))
     return false;
 
   if (*level == PrivilegeLevel::UNTRUSTED)
index 9e5b6af..9b4bd48 100644 (file)
@@ -86,7 +86,8 @@ class Step {
   };
 
   /** Standard constructor */
-  explicit Step(InstallerContext* context) : context_(context) { }
+  explicit Step(InstallerContext* context)
+    : context_(context), on_error_(nullptr) { }
 
   /** Virtual "empty" destructor */
   virtual ~Step() { }