On Wed, Sep 23, 2009 at 13:59, Pauli Virtanen wrote:
> ke, 2009-09-23 kello 10:01 +0200, Hrvoje Niksic kirjoitti:
> [clip]
>> I guess this one could be prevented by verifying that the buffer is
>> writable when setting the "writable" flag. When deserializing arrays, I
>> don't see a reason for th
ke, 2009-09-23 kello 10:01 +0200, Hrvoje Niksic kirjoitti:
[clip]
> I guess this one could be prevented by verifying that the buffer is
> writable when setting the "writable" flag. When deserializing arrays, I
> don't see a reason for the "base" property to even exist - sharing of
> the buffer
Pauli Virtanen wrote:
> Wed, 23 Sep 2009 09:15:44 +0200, Hrvoje Niksic wrote:
> [clip]
>> Numpy arrays with the "base" property are deserialized as arrays
>> pointing to a storage contained within a Python string. This is a
>> problem since such arrays are mutable and can mutate existing strings.
Wed, 23 Sep 2009 09:15:44 +0200, Hrvoje Niksic wrote:
[clip]
> Numpy arrays with the "base" property are deserialized as arrays
> pointing to a storage contained within a Python string. This is a
> problem since such arrays are mutable and can mutate existing strings.
> Here is how to create one:
Numpy arrays with the "base" property are deserialized as arrays
pointing to a storage contained within a Python string. This is a
problem since such arrays are mutable and can mutate existing strings.
Here is how to create one:
>>> import numpy, cPickle as p
>>> a = numpy.array([1, 2, 3])