aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
diff options
context:
space:
mode:
authorGabríel Arthúr Pétursson <gabriel@system.is>2017-06-03 01:38:49 +0000
committerLenny Komow <lenny@lunarg.com>2017-06-05 09:25:57 -0600
commit9eae491a07fd56c752a177d4729a33aa3aacd4dd (patch)
treef983d6cd5abf0220d006f0af5620d8020fe219a4 /loader/loader.c
parentccb58fd80322e8488b6e1b31673cb73821d83d03 (diff)
downloadusermoji-9eae491a07fd56c752a177d4729a33aa3aacd4dd.tar.xz
loader: Fix buffer overflow in loader_add_to_dev_ext_list
The size argument to a call to memcpy is for the wrong struct. The type of `ext->list[idx].props` is VkExtensionProperties. Credit goes to AddressSanitizer for spotting this bug.
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/loader/loader.c b/loader/loader.c
index f5c74a3d..cd249cb3 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -910,7 +910,7 @@ VkResult loader_add_to_dev_ext_list(const struct loader_instance *inst, struct l
ext_list->capacity *= 2;
}
- memcpy(&ext_list->list[idx].props, props, sizeof(struct loader_dev_ext_props));
+ memcpy(&ext_list->list[idx].props, props, sizeof(*props));
ext_list->list[idx].entrypoint_count = entry_count;
ext_list->list[idx].entrypoints =
loader_instance_heap_alloc(inst, sizeof(char *) * entry_count, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);