Message325128
I asked if there is an issue. In fact, all Python memory allocators start by checking if the size is larger than PY_SSIZE_T_MAX. Example:
void *
PyMem_RawMalloc(size_t size)
{
/*
* Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes.
* Most python internals blindly use a signed Py_ssize_t to track
* things without checking for overflows or negatives.
* As size_t is unsigned, checking for size < 0 is not required.
*/
if (size > (size_t)PY_SSIZE_T_MAX)
return NULL;
return _PyMem_Raw.malloc(_PyMem_Raw.ctx, size);
} |
|
Date |
User |
Action |
Args |
2018-09-12 07:52:57 | vstinner | set | recipients:
+ vstinner, loewis, nnorwitz, jcea, mark.dickinson, pitrou, alexandre.vassalotti, donmez, matejcik, jwilk, alex, dmalcolm, python-dev, deadshort, martin.panter, serhiy.storchaka, ztane, fweimer, Jeffrey.Walton, xiang.zhang, sir-sigurd, miss-islington |
2018-09-12 07:52:57 | vstinner | set | messageid: <1536738777.18.0.956365154283.issue1621@psf.upfronthosting.co.za> |
2018-09-12 07:52:57 | vstinner | link | issue1621 messages |
2018-09-12 07:52:57 | vstinner | create | |
|