From eabd9d6d2ac5b50dc06eb0c9ac2c3d8715eec030 Mon Sep 17 00:00:00 2001 From: Brian J Murray Date: Thu, 6 Jan 2022 15:13:51 -0800 Subject: [PATCH] Verify op_ is not a nullptr If op_ is a nullptr, the test runner can SIGSEGV. Test: manual, atest EncryptionOperationsTest#TripleDesCbcPkcs7PaddingCorrupted Bug: None Signed-off-by: Brian J Murray Change-Id: Ibdd6139952ca8bc83ac1a82202839feee39562e1 --- security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp index 3695f1e094..02462fce3a 100644 --- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp @@ -537,6 +537,9 @@ ErrorCode KeyMintAidlTestBase::Update(const string& input, string* output) { Status result; if (!output) return ErrorCode::UNEXPECTED_NULL_POINTER; + EXPECT_NE(op_, nullptr); + if (!op_) return ErrorCode::UNEXPECTED_NULL_POINTER; + std::vector o_put; result = op_->update(vector(input.begin(), input.end()), {}, {}, &o_put);