summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-08-14 21:45:19 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-08-14 21:45:19 +0000
commit24e58417bb39420d0aa1a079bd81fcd3a0248aad (patch)
tree7aeb01a825e08f9b1d2153d41087c3079a4559c5
parent82b376628500db55a81e6afd22562a2f84e599fc (diff)
parent65b688e1e633f9734fa4ea566d4930f1d46c7274 (diff)
[conflict] Merge "Vulkan: Avoid buffer overflow by ignoring duplicate extensions" into main am: 64b1cfe27c am: e36d57bc65 am: 65b688e1e6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/24409362 Change-Id: I3ae9a8c18c8efe368fc469707308ef7d58b3de90 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--vulkan/libvulkan/driver.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp
index 273cdd547e..aea897c84c 100644
--- a/vulkan/libvulkan/driver.cpp
+++ b/vulkan/libvulkan/driver.cpp
@@ -763,6 +763,17 @@ void CreateInfoWrapper::FilterExtension(const char* name) {
continue;
}
+ // Ignore duplicate extensions (see: b/288929054)
+ bool duplicate_entry = false;
+ for (uint32_t j = 0; j < filter.name_count; j++) {
+ if (strcmp(name, filter.names[j]) == 0) {
+ duplicate_entry = true;
+ break;
+ }
+ }
+ if (duplicate_entry == true)
+ continue;
+
filter.names[filter.name_count++] = name;
if (ext_bit != ProcHook::EXTENSION_UNKNOWN) {
if (ext_bit == ProcHook::ANDROID_native_buffer)