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

c++ H5File Constructor Error #5191

Open
lylong94 opened this issue Dec 25, 2024 · 1 comment
Open

c++ H5File Constructor Error #5191

lylong94 opened this issue Dec 25, 2024 · 1 comment
Assignees
Labels
Component - C++ C++ wrappers Priority - 3. Low 🔽 Code cleanup, small feature change requests, etc. Type - Bug / Bugfix Please report security issues to [email protected] instead of creating an issue on GitHub

Comments

@lylong94
Copy link

When create H5File object use constructor H5File(const H5std_string &name, unsigned int flags, const FileAccPropList &access_plist); may pass wrong const char* string to H5Fcreate.

The STL String default without the NULL character \0. So in the row p_get_file(name.c_str(), flags, create_plist, access_plist);, simply pass it by name.c_str() may not correct and add some characters.

The simplest way is append \0 before call c_str().

@lylong94
Copy link
Author

It appears not only in H5Fil, but also in all string.c_str().

@bmribler bmribler added Priority - 3. Low 🔽 Code cleanup, small feature change requests, etc. Component - C++ C++ wrappers Type - Bug / Bugfix Please report security issues to [email protected] instead of creating an issue on GitHub labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C++ C++ wrappers Priority - 3. Low 🔽 Code cleanup, small feature change requests, etc. Type - Bug / Bugfix Please report security issues to [email protected] instead of creating an issue on GitHub
Projects
None yet
Development

No branches or pull requests

2 participants