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: invalid race condition check in RegQueryValueEx #103

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

TomzBench
Copy link
Contributor

According to docs here

If the data has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, this size includes any terminating null character or characters unless the data was stored without them. For more information, see Remarks.

fixes #102

According to docs
[here](https://learn.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryvalueexw)

> If the data has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, this size includes any terminating null character or characters unless the data was stored without them. For more information, see Remarks.

fixes rodrigocfd#102

Signed-off-by: Thomas Chiantia <thomas.chiantia@gmail.com>
@rodrigocfd rodrigocfd self-assigned this Nov 1, 2023
@rodrigocfd
Copy link
Owner

Hi Tom,

Did your check your code against other entries, other than LOCAL_MACHING\HARDWARE\DEVICEMAP\SERIALCOM?

@rodrigocfd
Copy link
Owner

Nevermind, your fix is correct. I'm merging this PR.

Thank you.

@rodrigocfd rodrigocfd merged commit 1918adf into rodrigocfd:master Nov 1, 2023
@TomzBench
Copy link
Contributor Author

Did your check your code against other entries, other than LOCAL_MACHING\HARDWARE\DEVICEMAP\SERIALCOM?

I switched to using "SYSTEM\CurrentControlSet\Control\COM Name Arbiter\Devices" because it also has the PID and VID numbers, and observed the same behavior there.

Nevermind, your fix is correct. I'm merging this PR.

Great!

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.

validate_retrieved_reg_val always fails
2 participants