diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-03 01:08:25 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-03 01:08:25 +0000 |
commit | e013dd1a8b8f0df65b20c4de224effa1a7fcc61b (patch) | |
tree | 6459340754184961f38b998c2da20b9a09a827d1 /identity/aidl/default/common/WritableIdentityCredential.cpp | |
parent | a37d468b54831c5ec84fe986ea932449d836f28f (diff) | |
parent | 09c9ab7c9a2bc4b2ecb21728be9e186827775847 (diff) |
Snap for 7419753 from 09c9ab7c9a2bc4b2ecb21728be9e186827775847 to sc-release
Change-Id: I79ef4b2921fb59494fc464d9f8d61532213346e5
Diffstat (limited to 'identity/aidl/default/common/WritableIdentityCredential.cpp')
-rw-r--r-- | identity/aidl/default/common/WritableIdentityCredential.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/identity/aidl/default/common/WritableIdentityCredential.cpp b/identity/aidl/default/common/WritableIdentityCredential.cpp index 25f129b14b..200ee61df4 100644 --- a/identity/aidl/default/common/WritableIdentityCredential.cpp +++ b/identity/aidl/default/common/WritableIdentityCredential.cpp @@ -210,6 +210,15 @@ ndk::ScopedAStatus WritableIdentityCredential::beginAddEntry( "numAccessControlProfileRemaining_ is not zero")); } + // Ensure passed-in profile ids reference valid access control profiles + for (const int32_t id : accessControlProfileIds) { + if (accessControlProfileIds_.find(id) == accessControlProfileIds_.end()) { + return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage( + IIdentityCredentialStore::STATUS_INVALID_DATA, + "An id in accessControlProfileIds references non-existing ACP")); + } + } + if (remainingEntryCounts_.size() == 0) { return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage( IIdentityCredentialStore::STATUS_INVALID_DATA, "No more namespaces to add to")); |