Message289829
here is the patch updated according to your suggestions, Serhiy.
however, I wonder about the case of a too large _length_.
shouldn't we raise a MemoryError in such a case, in accordance with #29833?
BTW, while inspecting code related to a too large _length_, I came across this
(in PyCArrayType_new):
if (length * itemsize < 0) {
PyErr_SetString(PyExc_OverflowError,
"array too large");
goto error;
}
I am not sure, but isn't this check unsafe? (e.g. if length == 2 ** 30, and
itemsize == 4, couldn't the product be 0 on some platforms?)
but maybe the code before this check makes more checks. I didn't make a
thorough inspection... |
|
| Date |
User |
Action |
Args |
| 2017-03-18 20:59:08 | Oren Milman | set | recipients:
+ Oren Milman, amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka |
| 2017-03-18 20:59:08 | Oren Milman | set | messageid: <[email protected]> |
| 2017-03-18 20:59:08 | Oren Milman | link | issue29843 messages |
| 2017-03-18 20:59:08 | Oren Milman | create | |
|