From: Ilho Kim Date: Wed, 24 Aug 2022 07:06:17 +0000 (+0900) Subject: Add exception handling to StepSignature X-Git-Tag: accepted/tizen/unified/20220825.135043~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fappfw%2Fapp-installers.git;a=commitdiff_plain;h=d83fcce6f5e8ae015b9aecca6adda1af5ca210aa Add exception handling to StepSignature If StepSignature's precheck fails, the variable 'signature_' is not initialized Change-Id: Ie605111e8572e6d7ccf5e8e161fa5e6f29b13dee Signed-off-by: Ilho Kim --- diff --git a/src/common/step/security/step_signature.cc b/src/common/step/security/step_signature.cc index 6c7abdd..3a63882 100644 --- a/src/common/step/security/step_signature.cc +++ b/src/common/step/security/step_signature.cc @@ -132,6 +132,9 @@ Step::Status StepSignature::process() { } Step::Status StepSignature::undo() { + if (signature_ == nullptr) + return Step::Status::OK; + bf::remove(signature_->GetFilePath()); if (bf::exists(signature_->GetBackupPath())) bf::rename(signature_->GetBackupPath(), signature_->GetFilePath());