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

Fix shared_resources accessing uninitialized variables #7600

Merged
merged 1 commit into from
May 24, 2022

Conversation

Smjert
Copy link
Member

@Smjert Smjert commented May 20, 2022

The functions trying to get the Type, AllowMaximum
and MaximumAllowed can fail and this case is not considered.
Check the result of the functions and use -1 as failure.

@Smjert
Copy link
Member Author

Smjert commented May 20, 2022

This is only a hotfix, the table seems to have other issues, namely the representation of the data for Type and MaximumAllowed is not correct; while the underlying type is a long, they should be represented as the documentation for the WMI table dictates, so as uint32.

@Smjert Smjert added the do not merge Do not merge PR as it's pending on some discussion or external factor. Reviewer should have context. label May 23, 2022
@Smjert Smjert force-pushed the stefano/fix/shared_resources branch from 1918241 to ecb62e0 Compare May 23, 2022 17:03
@Smjert Smjert removed the do not merge Do not merge PR as it's pending on some discussion or external factor. Reviewer should have context. label May 23, 2022
The functions trying to get the Type, AllowMaximum
and MaximumAllowed can fail and this case is not considered.
Check the result of the functions and use -1 as failure.
@Smjert Smjert force-pushed the stefano/fix/shared_resources branch from ecb62e0 to c724a8b Compare May 24, 2022 14:24
Copy link
Member

@directionless directionless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do this enough, and it seems like we need a helper. But simple fix is good

@Smjert Smjert merged commit 968e0e9 into osquery:master May 24, 2022
@Smjert Smjert deleted the stefano/fix/shared_resources branch May 24, 2022 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants