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 4975f96e761cb8bfd35b9c4af2bde006531f411d..0d7b9244fa6be1b5134952627171be3d7035085f 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 1e1f661b383c63d8980f6b471b9091b1345aaf52..2e3301ec802c5a22cbf6cde67dfc03fd412905a1 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 9e5b6af2c58fbd764c9320ebf06342452f123ef5..9b4bd48bbd9daf9edc3f51e2816561fa9dba7093 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() { }