mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #12848: The pure Python pickle implementation now treats object lengths as unsigned 32-bit integers, like the C implementation does.
Patch by Serhiy Storchaka.
This commit is contained in:
parent
82e60de727
commit
bf6ecf92fa
3 changed files with 31 additions and 14 deletions
|
|
@ -1579,7 +1579,7 @@ save_long(PicklerObject *self, PyObject *obj)
|
|||
* byte at the start, and cut it back later if possible.
|
||||
*/
|
||||
nbytes = (nbits >> 3) + 1;
|
||||
if (nbytes > INT_MAX) {
|
||||
if (nbytes > 0x7fffffffL) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"long too large to pickle");
|
||||
goto error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue