numpy/numpy — pull request #2882 by seberg (2013-01-03 16:43:25+00:00)
Title: BUG: Fix CheckStrides and strides setter checks for available memory

This changes the logic of PyArray_CheckStrides to really check the
full extent the new array will have. It also changes the stride
setting to calculate the full real extent of the underlying array
without assuming (usually correctly) that the strides of the base
array are regular.

Add some tests for cases that previously failed.
This "closes Issue gh-2503"

---

I don't love duplicating that code, but I did not know a great alternative, this will break abuses that explicitly created invalid arrays obviously.