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

Undefined behavior in ncx.m4 #2799

Closed
wants to merge 4 commits into from

Conversation

WardF
Copy link
Member

@WardF WardF commented Nov 14, 2023

Closed #2797 because I'm not sure what I was getting at to start with, re-opened under this branch.

The undefined behavior appears to be a side effect of casting to a narrower data type. The logic in ncx.m4 was added way back in 2016, in #319. Reverting to previous behavior, where we return NC_ERANGE when attempting to convert a value too large (or two small) into a narrower data type, fixes the issue. I need to dig in and figure out if this is the behavior we want, or if we want to make broader changes.

@WardF WardF added this to the 4.9.3 milestone Nov 14, 2023
@WardF WardF self-assigned this Nov 14, 2023
@WardF WardF closed this Nov 17, 2023
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.

Undefined behavior in ncx.c, nc_test
1 participant