Skip to content

Fix Coverity CID 1530056: sanitize tainted allocation size in hid_report_reconstructor_test.c#776

Merged
Youw merged 2 commits intomasterfrom
copilot/fix-tainted-allocation-bug
Mar 9, 2026
Merged

Fix Coverity CID 1530056: sanitize tainted allocation size in hid_report_reconstructor_test.c#776
Youw merged 2 commits intomasterfrom
copilot/fix-tainted-allocation-bug

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

Fixes: #563

Add a bounds check on size_of_preparsed_data (computed from file-sourced
FirstByteOfLinkCollectionArray and NumberLinkCollectionNodes) before
passing it to malloc(). This ensures the tainted scalar values read via
sscanf are sanitized by verifying the allocation size is within a
permissible range (1 MB).

Co-authored-by: Youw <5939659+Youw@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix tainted allocation bug in hid_report_reconstructor_test Fix Coverity CID 1530056: sanitize tainted allocation size in hid_report_reconstructor_test.c Mar 9, 2026
Copilot finished work on behalf of Youw March 9, 2026 15:59
@Youw Youw marked this pull request as ready for review March 9, 2026 16:05
@Youw Youw merged commit 55aab02 into master Mar 9, 2026
33 of 34 checks passed
@Youw Youw deleted the copilot/fix-tainted-allocation-bug branch March 9, 2026 16:52
@mcuee mcuee added bug Something isn't working Windows Related to Windows backend labels Mar 10, 2026
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

Successfully merging this pull request may close these issues.

"Untrusted allocation size" in tests

3 participants