From b37d58799d477a06a6e7ed1809acc51792912a7b Mon Sep 17 00:00:00 2001 From: orbisai0security Date: Tue, 12 May 2026 04:12:39 +0000 Subject: [PATCH] fix: V-001 security vulnerability Automated security fix generated by Orbis Security AI --- loader/loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/loader.c b/loader/loader.c index 8c3058a0e..91f15efc8 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -1131,7 +1131,7 @@ VkResult loader_add_to_ext_list(const struct loader_instance *inst, struct loade // add to list at end // check for enough capacity - if (ext_list->count * sizeof(VkExtensionProperties) >= ext_list->capacity) { + if (ext_list->count >= ext_list->capacity / sizeof(VkExtensionProperties)) { void *new_ptr = loader_instance_heap_realloc(inst, ext_list->list, ext_list->capacity, ext_list->capacity * 2, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); if (new_ptr == NULL) { @@ -1174,7 +1174,7 @@ VkResult loader_add_to_dev_ext_list(const struct loader_instance *inst, struct l uint32_t idx = ext_list->count; // add to list at end // check for enough capacity - if (idx * sizeof(struct loader_dev_ext_props) >= ext_list->capacity) { + if (idx >= ext_list->capacity / sizeof(struct loader_dev_ext_props)) { void *new_ptr = loader_instance_heap_realloc(inst, ext_list->list, ext_list->capacity, ext_list->capacity * 2, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);