summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/driver.cpp
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-08-12 00:15:40 +0000
committer Ian Elliott <ianelliott@google.com> 2023-08-14 20:04:35 +0000
commit65b688e1e633f9734fa4ea566d4930f1d46c7274 (patch)
treefdfc164913c4c0813beee126f56f348f37b6c9ce /vulkan/libvulkan/driver.cpp
parent62a951a8dd40e39b6d9fd24c0d0229b612c50e96 (diff)
parente36d57bc652451d1682aa38b6644864e8fb43aaa (diff)
[conflict] Merge "Vulkan: Avoid buffer overflow by ignoring duplicate extensions" into main am: 64b1cfe27c am: e36d57bc65
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2702989 Change-Id: I6403163b14d62b50232d1197ecb2b14e946efe13 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'vulkan/libvulkan/driver.cpp')
-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)