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

UB creating a reference with an under-aligned address #1009

Closed
programmerjake opened this issue Jul 13, 2023 · 3 comments
Closed

UB creating a reference with an under-aligned address #1009

programmerjake opened this issue Jul 13, 2023 · 3 comments

Comments

@programmerjake
Copy link

Describe the bug

x86_64-pc-windows-gnu
sysinfo-0.29.4

more details starting here:
retep998/winapi-rs#1043 (comment)

@LunNova
Copy link
Contributor

LunNova commented Jul 13, 2023

It looks like there's more UB here, set_len is used before calling NtQuerySystemInformation or confirming the ntstatus value so can be pointing at uninitialized memory and the docs require "The elements at old_len..new_len must be initialized."

If ntstatus is an error value that isn't STATUS_INFO_LENGTH_MISMATCH the error is logged but ignored and then uninitialized memory is accessed.

@GuillaumeGomez
Copy link
Owner

Thanks for reporting the bug and for the extra details! PRs are very welcome, otherwise I'll get to it in a few days.

@GuillaumeGomez
Copy link
Owner

I released 0.29.5 with the fix from #1010. I'll close this issue for the time being but if the problem is still there, please re-open it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants