Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Untrusted allocation size" in tests #563

Open
Youw opened this issue May 21, 2023 · 1 comment
Open

"Untrusted allocation size" in tests #563

Youw opened this issue May 21, 2023 · 1 comment
Labels
bug Something isn't working Windows Related to Windows backend

Comments

@Youw
Copy link
Member

Youw commented May 21, 2023

Coverity issue CID1530056

Low impact - tests only.

CC: @JoergAtGithub

@Youw Youw added bug Something isn't working Windows Related to Windows backend labels May 21, 2023
@Youw
Copy link
Member Author

Youw commented May 21, 2023

hid_report_reconstructor_test.c:

 95                if (FirstByteOfLinkCollectionArray != 0 && NumberLinkCollectionNodes != 0) {
   	514. var_assign_var: Assigning: size_of_preparsed_data = 44ULL + FirstByteOfLinkCollectionArray + NumberLinkCollectionNodes * 16ULL. Both are now tainted.
 96                        size_t size_of_preparsed_data = offsetof(hidp_preparsed_data, caps) + FirstByteOfLinkCollectionArray + (NumberLinkCollectionNodes * sizeof(hid_pp_link_collection_node));
 97                        pp_data->FirstByteOfLinkCollectionArray = FirstByteOfLinkCollectionArray;
 98                        pp_data->NumberLinkCollectionNodes = NumberLinkCollectionNodes;
 99                        FirstByteOfLinkCollectionArray = 0;
100                        NumberLinkCollectionNodes = 0;
   	
CID 1530056 (#1-15 of 15): Untrusted allocation size (TAINTED_SCALAR)
515. tainted_data: Passing tainted expression size_of_preparsed_data to malloc, which uses it as an allocation size.
   	Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
101                        pp_data = malloc(size_of_preparsed_data);
102                        memcpy(pp_data, &static_pp_data, sizeof(static_pp_data));
103                }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Windows Related to Windows backend
Projects
None yet
Development

No branches or pull requests

1 participant