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

Remove unused and broken HIDPowerDevice_::sendDate method #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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