summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/driver.cpp
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-08-14 19:50:58 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-08-14 19:50:58 +0000
commit1700661aa220a6cd42ad1a563b58f731789ecd91 (patch)
tree6953786c20fcf4fb3c856a7954ed64ae6279d699 /vulkan/libvulkan/driver.cpp
parentb381a8bad373850cc40f88a1c82249123e12cbbe (diff)
parent3b48e15760dbc6999833f1be83b0cf75e2bcf8e3 (diff)
Merge "Vulkan: Avoid buffer overflow by ignoring duplicate extensions" into udc-qpr-dev
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 d21deef493..bdba27e6a1 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)