diff options
author | Brian J Murray <brianjmurray@google.com> | 2022-01-06 15:13:51 -0800 |
---|---|---|
committer | Brian J Murray <brianjmurray@google.com> | 2022-01-06 15:26:16 -0800 |
commit | eabd9d6d2ac5b50dc06eb0c9ac2c3d8715eec030 (patch) | |
tree | 5f94ebc48ae74819b60100ea1491fe1771cc7e0f /security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp | |
parent | fd593414cd97bb9a83a7dfcd14d71f67f287a45c (diff) |
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 <brianjmurray@google.com>
Change-Id: Ibdd6139952ca8bc83ac1a82202839feee39562e1
Diffstat (limited to 'security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp')
-rw-r--r-- | security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<uint8_t> o_put; result = op_->update(vector<uint8_t>(input.begin(), input.end()), {}, {}, &o_put); |