[XAM] Fix missing buffer check on XamEnumerate.

This commit is contained in:
gibbed 2021-05-08 08:03:14 -05:00 committed by Rick Gibbed
parent d2ca54d909
commit 084b8c5dbe
1 changed files with 2 additions and 0 deletions

View File

@ -38,6 +38,8 @@ uint32_t xeXamEnumerate(uint32_t handle, uint32_t flags, lpvoid_t buffer_ptr,
auto e = kernel_state()->object_table()->LookupObject<XEnumerator>(handle);
if (!e) {
result = X_ERROR_INVALID_HANDLE;
} else if (!buffer_ptr) {
result = X_ERROR_INVALID_PARAMETER;
} else {
size_t needed_buffer_size = e->item_size() * e->items_per_enumerate();