diff options
author | 2023-08-14 19:50:58 +0000 | |
---|---|---|
committer | 2023-08-14 19:50:58 +0000 | |
commit | 1700661aa220a6cd42ad1a563b58f731789ecd91 (patch) | |
tree | 6953786c20fcf4fb3c856a7954ed64ae6279d699 /vulkan/libvulkan/driver.cpp | |
parent | b381a8bad373850cc40f88a1c82249123e12cbbe (diff) | |
parent | 3b48e15760dbc6999833f1be83b0cf75e2bcf8e3 (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.cpp | 11 |
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) |