diff options
| author | Gabríel Arthúr Pétursson <gabriel@system.is> | 2017-06-03 01:38:49 +0000 |
|---|---|---|
| committer | Lenny Komow <lenny@lunarg.com> | 2017-06-05 09:25:57 -0600 |
| commit | 9eae491a07fd56c752a177d4729a33aa3aacd4dd (patch) | |
| tree | f983d6cd5abf0220d006f0af5620d8020fe219a4 /loader/loader.c | |
| parent | ccb58fd80322e8488b6e1b31673cb73821d83d03 (diff) | |
| download | usermoji-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.c | 2 |
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); |
