Skip to content

Commit 55c2f3c

Browse files
Making defensive copy of keyIds
1 parent ca42177 commit 55c2f3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/amazonaws/encryptionsdk/keyrings/KmsKeyring.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class KmsKeyring implements Keyring {
4848
KmsKeyring(DataKeyEncryptionDao dataKeyEncryptionDao, List<String> keyIds, String generatorKeyId) {
4949
requireNonNull(dataKeyEncryptionDao, "dataKeyEncryptionDao is required");
5050
this.dataKeyEncryptionDao = dataKeyEncryptionDao;
51-
this.keyIds = keyIds == null ? emptyList() : unmodifiableList(keyIds);
51+
this.keyIds = keyIds == null ? emptyList() : unmodifiableList(new ArrayList<>(keyIds));
5252
this.generatorKeyId = generatorKeyId;
5353
this.isDiscovery = this.generatorKeyId == null && this.keyIds.isEmpty();
5454

0 commit comments

Comments
 (0)