Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions windows/test/hid_report_reconstructor_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ static hidp_preparsed_data * alloc_preparsed_data_from_file(char* filename)

if (FirstByteOfLinkCollectionArray != 0 && NumberLinkCollectionNodes != 0) {
size_t size_of_preparsed_data = offsetof(hidp_preparsed_data, caps) + FirstByteOfLinkCollectionArray + (NumberLinkCollectionNodes * sizeof(hid_pp_link_collection_node));
if (size_of_preparsed_data > 1024 * 1024) {
fprintf(stderr, "Error: preparsed data size too large: %zu\n", size_of_preparsed_data);
fclose(file);
return NULL;
}
pp_data->FirstByteOfLinkCollectionArray = FirstByteOfLinkCollectionArray;
pp_data->NumberLinkCollectionNodes = NumberLinkCollectionNodes;
FirstByteOfLinkCollectionArray = 0;
Expand Down
Loading