Repository navigation
Fix issues on WinDivert::uninstall() - #30
Merged
Merged
Conversation
MaybeUninit::uninit() is not bound to any variable, so the temporary is dropped at the end of the statement, leaving `status` as a dangling pointer into the freed stack slot. Passing it to ControlService() as an out-pointer then makes the kernel write through a dangling pointer, which is undefined behavior. Bind the MaybeUninit<SERVICE_STATUS> to a local so it outlives the pointer.
Owner
|
It seems I forgot to backport this two fix from the 0.7 prerelease versions Feel free to bump the MSRV to "1.71", its been long enough since release Thanks for the contribution! |
This should be null terminated or OpenServiceA() have no chance to know where str is stopped.
Contributor
Author
|
Bumped msrv and changed to "...\0" since c".." is not supported in 1.71. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes two issues in WinDivert::uninstall():
Note: (2) overlaps with #29. It was authored on Jul 13 (see AuthorDate) in dilluti0n/dpibreak@82c8d80, before #29 was opened. I'm upstreaming them together since they touch the same function. Happy to rebase and drop the second commit if #29 is merged first.