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

NC4_inq_type_equal() does not check return code of H5Tequal() #775

Closed
edhartnett opened this issue Jan 18, 2018 · 0 comments · Fixed by #789
Closed

NC4_inq_type_equal() does not check return code of H5Tequal() #775

edhartnett opened this issue Jan 18, 2018 · 0 comments · Fixed by #789

Comments

@edhartnett
Copy link
Contributor

edhartnett commented Jan 18, 2018

In function NC4_inq_type_equal(), there is this code:

   /* Are the two types equal? */
   if (equalp)
      *equalp = (int)H5Tequal(type1->native_hdf_typeid, type2->native_hdf_typeid);

However, when H5Tequal() returns an error (-1) hilarious confusion will ensue.

The return value of H5Tequal() needs to be checked, and NC_EHDFERR returned if it fails.

Note that in these cases, nc_inq_type_equal() will get an incorrect result, -1, which the user will interpret as equal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant