Esme Povirk (@madewokherd) commented about dlls/uiautomationcore/uia_com_client.c:
- *out_length = element_arr->elements_count;
- return S_OK;
+}
+static HRESULT WINAPI uia_element_array_GetElement(IUIAutomationElementArray *iface, int idx,
IUIAutomationElement **out_elem)
+{
- struct uia_element_array *element_arr = impl_from_IUIAutomationElementArray(iface);
- TRACE("%p, %p\n", iface, out_elem);
- if (!out_elem)
return E_POINTER;
- if (idx >= element_arr->elements_count)
idx is signed so it should be checked for negative values too.