summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-11-24 19:40:21 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-11-24 19:40:21 (GMT)
commitbf6ecf92fa9800b1b99d78a82518bcae30115e0c (patch)
tree8d366bc0e181a5582428d8c996dc45c12257c95a /Modules/_pickle.c
parent82e60de7277a9dc569c983d913a24b870c3ee2b8 (diff)
downloadcpython-bf6ecf92fa9800b1b99d78a82518bcae30115e0c.zip
cpython-bf6ecf92fa9800b1b99d78a82518bcae30115e0c.tar.gz
cpython-bf6ecf92fa9800b1b99d78a82518bcae30115e0c.tar.bz2
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.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r--Modules/_pickle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index fc5f871..18eaa38 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -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;