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

Various bug fixes #199

Merged
merged 3 commits into from
May 26, 2024
Merged

Conversation

zacikpa
Copy link
Contributor

@zacikpa zacikpa commented May 23, 2024

This PR fixes various issues found by static analysis tools. The most serious issue is in cpuid_get_hypervisor, which leads to segmentation faults when the caller passes a NULL parameter, even though the documentation claims that it is safe.

All three leaks would occur in erroneous
function paths.
The data should be loaded into the local variable
`mydata`, not into the NULL parameter.
First check whether we are past the array, only
then read and check its values.
Copy link
Collaborator

Choose a reason for hiding this comment

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

LGTM, good work!

libcpuid/cpuid_main.c Show resolved Hide resolved
@TheTumultuousUnicornOfDarkness TheTumultuousUnicornOfDarkness merged commit 381b335 into anrieff:master May 26, 2024
10 checks passed
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.

2 participants