From d83fcce6f5e8ae015b9aecca6adda1af5ca210aa Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Wed, 24 Aug 2022 16:06:17 +0900 Subject: [PATCH] Add exception handling to StepSignature If StepSignature's precheck fails, the variable 'signature_' is not initialized Change-Id: Ie605111e8572e6d7ccf5e8e161fa5e6f29b13dee Signed-off-by: Ilho Kim --- src/common/step/security/step_signature.cc | 3 +++ 1 file changed, 3 insertions(+) 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()); -- 2.7.4