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

ToNpyDims: Shared reference is casted to mutable pointer that might be mutated #343

Closed
shumpohl opened this issue Aug 27, 2022 · 2 comments

Comments

@shumpohl
Copy link

shumpohl commented Aug 27, 2022

If I understand this numpy code correctly the memory location passed via PyArray_Dims is mutated if a wildcard dimension i.e. -1 is present.

This means that reshape and resize calls via ToNpyDims results in UB in all invocations with a -1 since the ptr is casted from a shared slice reference.

@shumpohl
Copy link
Author

Should be a simple fix by using slice_mut

@davidhewitt
Copy link
Member

Fixed in #344

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

No branches or pull requests

2 participants