From 2165de0046c76ad9e4ba91d9c90e74c69b31c50a Mon Sep 17 00:00:00 2001 From: Tommy Chiu Date: Mon, 1 Jul 2024 06:29:40 +0000 Subject: [PATCH] Fix invalid access on nullptr Should return when there's no content be parsed. Bug: 330791928 Test: rkp_factory_extraction_tool64 Change-Id: I45302ec20a0a931d2f44a7e36f613858c10fe21e --- security/keymint/support/remote_prov_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp index a830041d64..5ab1514b06 100644 --- a/security/keymint/support/remote_prov_utils.cpp +++ b/security/keymint/support/remote_prov_utils.cpp @@ -824,7 +824,7 @@ ErrMsgOr validateCertChain(const cppbor::Array& chain) { } if (i == chain.size() - 1) { auto key = getRawPublicKey(pubKey); - if (!key) key.moveMessage(); + if (!key) return key.moveMessage(); rawPubKey = key.moveValue(); } }