[Numpy-discussion] fromfile can segfault if data is corrupted

Charles R Harris charlesr.harris@gmail....
Tue Dec 15 12:28:43 CST 2009


On Tue, Dec 15, 2009 at 11:20 AM, Michael Droettboom <mdroe@stsci.edu>wrote:

> I just discovered a bug in fromfile where it can segfault if the file data
> is corrupted in such a way that the array size is insanely large.  (It was a
> byte-swapping problem in my own code, but it would be preferable to get an
> exception rather than a crash).
>
> It's a simple fix to propagate the "array too large" exception before
> trying to dereference the NULL array pointer (ret) in PyArray_FromFile (see
> attached patch).  But my question is: is this an appropriate fix for 1.4 (it
> seems pretty straightforward), or should I only make this to the trunk?
>
>
David can weigh in here, but I think you should backport it. It's a bugfix,
small, and there is going to be another rc.

On the other hand, Travis should stop backporting new functionality.

<snip>

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20091215/2f85c5e9/attachment.html 


More information about the NumPy-Discussion mailing list