summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-27 05:01:57 +0200
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-27 05:01:57 +0200
commita714b2b786ab0868ec1ad86032c9dc2c39238e87 (patch)
tree1a47d1bd6d5097c6435fd270bc3aafcff2c224b1
parentSnap for 8632302 from 772366e424f81f56aaf437ce40e51cbface5c32c to udc-release (diff)
parent[automerger skipped] Import translations. DO NOT MERGE ANYWHERE am: fe7c99d955 -s ours am: aa88f25167 -s ours (diff)
downloadandroid_bootable_recovery-a714b2b786ab0868ec1ad86032c9dc2c39238e87.tar
android_bootable_recovery-a714b2b786ab0868ec1ad86032c9dc2c39238e87.tar.gz
android_bootable_recovery-a714b2b786ab0868ec1ad86032c9dc2c39238e87.tar.bz2
android_bootable_recovery-a714b2b786ab0868ec1ad86032c9dc2c39238e87.tar.lz
android_bootable_recovery-a714b2b786ab0868ec1ad86032c9dc2c39238e87.tar.xz
android_bootable_recovery-a714b2b786ab0868ec1ad86032c9dc2c39238e87.tar.zst
android_bootable_recovery-a714b2b786ab0868ec1ad86032c9dc2c39238e87.zip
-rw-r--r--otautil/verifier.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/otautil/verifier.cpp b/otautil/verifier.cpp
index 8a65566ec..83ad7082b 100644
--- a/otautil/verifier.cpp
+++ b/otautil/verifier.cpp
@@ -309,13 +309,15 @@ int verify_file(VerifierInterface* package, const std::vector<Certificate>& keys
}
static std::vector<Certificate> IterateZipEntriesAndSearchForKeys(const ZipArchiveHandle& handle) {
- void* cookie;
+ void* cookie{};
+
int32_t iter_status = StartIteration(handle, &cookie, "", "x509.pem");
if (iter_status != 0) {
LOG(ERROR) << "Failed to iterate over entries in the certificate zipfile: "
<< ErrorCodeString(iter_status);
return {};
}
+ std::unique_ptr<void, decltype(&EndIteration)> cookie_guard(cookie, &EndIteration);
std::vector<Certificate> result;