hid: Check preparsed data magic in HidP_GetLinkCollectionNodes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b99da49a75
commit
dec362a766
|
@ -1001,6 +1001,9 @@ NTSTATUS WINAPI HidP_GetLinkCollectionNodes(HIDP_LINK_COLLECTION_NODE *LinkColle
|
||||||
|
|
||||||
TRACE("(%p, %p, %p)\n", LinkCollectionNode, LinkCollectionNodeLength, PreparsedData);
|
TRACE("(%p, %p, %p)\n", LinkCollectionNode, LinkCollectionNodeLength, PreparsedData);
|
||||||
|
|
||||||
|
if (data->magic != HID_MAGIC)
|
||||||
|
return HIDP_STATUS_INVALID_PREPARSED_DATA;
|
||||||
|
|
||||||
if (*LinkCollectionNodeLength < data->caps.NumberLinkCollectionNodes)
|
if (*LinkCollectionNodeLength < data->caps.NumberLinkCollectionNodes)
|
||||||
return HIDP_STATUS_BUFFER_TOO_SMALL;
|
return HIDP_STATUS_BUFFER_TOO_SMALL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue