Skip to content

Conversation

forderud
Copy link
Contributor

@forderud forderud commented Oct 15, 2024

Alternative to #28.

The method currently uses a local bval variable as argument when calling HID().SendReport(...). This is problematic, since the SendReport method doesn't use bval immediately. It instead captures a pointer to bval which is accessed when the report is sent at a later point. This leads to a use-after-free situation when the pointer captured by SendReport no longer point to bval, but some other unknown data.

Proposing to delete the sendDate method, since it's both broken and unused. Client code can anyhow set date parameters through manual setFeature calls as was done in #25.

@forderud
Copy link
Contributor Author

@abratchik Would it be possible for you to take a look at either this PR or #28?

I've already tested the change locally.

The method currently uses a local bval variable as argument when calling HID().SendReport(...). This is problematic, since the SendReport method doesn't use bval immediately. It instead captures a pointer to bval which is accessed when the report is sent at a later point. This leads to a use-after-free situation when the pointer captured by SendReport no longer point to bval, but some other unknown data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant