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

Potential NMBS_ERROR_INVALID_ARGUMENT when calling nmbs_create() #65

Open
debevv opened this issue Sep 20, 2024 · 0 comments
Open

Potential NMBS_ERROR_INVALID_ARGUMENT when calling nmbs_create() #65

debevv opened this issue Sep 20, 2024 · 0 comments

Comments

@debevv
Copy link
Owner

debevv commented Sep 20, 2024

Following #55 I realized that there was no way to check if the new crc_calc() function pointer was defined by the user or not, since there is no guarantee that the user initializes the nmbs_platform_conf struct to zero.

For this reason, with #64 (which marks version 1.18.0), I introduced 2 new _create() APIs that the user must call to create the nmbs_platform_conf and nmbs_callbacks struct, nmbs_platform_conf_create() and nmbs_callbacks_create().

To force the usage of these functions inside old codebases, I introduced a runtime check inside nmbs_create() and nmbs_server_create() returning NMBS_ERROR_INVALID_ARGUMENT when one of these structs is not initialized properly.

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

1 participant