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

get_info: zero-initialize numeric return value #418

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

detule
Copy link
Collaborator

@detule detule commented Aug 19, 2024

Hi Team:

I was thinking about possible low-touch approaches to resolving the issue highlighted in #398. One way to do that, I think, is whenever a user retrieves an InfoType returning a numeric value, we should advise them that they should consider using the uint64_t flavor of get_info.

To make that possible, we need to zero-initialize the return value to make sure that any over-allocated bits are unset; Both on x86/debian/gcc11 as well as x86/macos/clang15 the updated unit test fails highlighting the issue.

Thanks!

Copy link
Member

@mloskot mloskot left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@detule
Copy link
Collaborator Author

detule commented Aug 28, 2024

LGTM. Thanks!

Great - thank you! Let me know if you think the postgresql failure is related; otherwise it should be good-to-go.

@mloskot
Copy link
Member

mloskot commented Aug 28, 2024

I don't think it is.

@mloskot mloskot added this to the 2.15+ milestone Aug 28, 2024
@mloskot mloskot merged commit 29d0f3d into nanodbc:main Aug 28, 2024
59 of 60 checks passed
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