-
Notifications
You must be signed in to change notification settings - Fork 31
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
NCDatasets.load!
does not check the sizes and data types of output arrays and buffers
#211
Comments
OK, it is mentioned in the doc string (https://github.com/Alexander-Barth/NCDatasets.jl/blob/master/src/variable.jl#L104 ) of the But in any case, I agree, that it is better that the default should be safer. In the recent commit there is now a bounds check and if the types do not match then one gets a method error. The bounds check can be disabled by using e.g. |
Now Thank you very much for adding these checks and upgrading the doc string! I can close this issue after a pull that merges this commit into the master branch. |
Describe the bug
The documentation of
NCDatasets.jl
mentions thatNCDatasets.load!
can be used to improve the performance of this package. However, this function does not check the sizes and the data types of the output arrays and buffers. When the size or the data type of the output array or buffer is wrong, the output result will be wrong andJulia
itself may even crash due to a segmentation fault.To Reproduce
Expected behavior
NCDatasets.load!
should give an error when the size or the data type of the output array or buffer is incorrect. At least, the documentation should not mention usingNCDatasets.load!
without describing its potential danger.A safe version of
load!
that does these checks will be very helpful.Environment
Full output
The text was updated successfully, but these errors were encountered: