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

EnsureProcessIsClosed function missing correct access rights and does not close handle #249

Open
Optimierungswerfer opened this issue Jul 30, 2024 · 0 comments

Comments

@Optimierungswerfer
Copy link

The process handle that gets passed to WaitForSingleObject in this line is missing the SYNCHRONIZE access right as specified here. This needs to be requested in the adjacent OpenProcess call alongside the PROCESS_TERMINATE access right.

This results in the WaitForSingleObject call to always immediately return with a result that always leads to the explicit forceful termination code path. This fact hides the other issue with this function that the opened process handle is only closed in this code path when it should be closed outside the if.

Furthermore, the result of OpenProcess should be evaluated as it might be NULL.

Nothing breaking, just caused some confusion on our side as we took this function as an example on how to wait for the web view process to finish before doing some clean up on our side.

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

No branches or pull requests

1 participant