summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-11-24 19:41:34 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-11-24 19:41:34 (GMT)
commit9982c53c2feb6e6e03c4c6d87d77c6ee69bfc435 (patch)
tree66b50f6426804af6693f4a9dda24f01584e90323 /Modules
parent9ab09d129e7908d58f8141cbf0ef824c1037a7e4 (diff)
parentbf6ecf92fa9800b1b99d78a82518bcae30115e0c (diff)
downloadcpython-9982c53c2feb6e6e03c4c6d87d77c6ee69bfc435.zip
cpython-9982c53c2feb6e6e03c4c6d87d77c6ee69bfc435.tar.gz
cpython-9982c53c2feb6e6e03c4c6d87d77c6ee69bfc435.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')
-rw-r--r--Modules/_pickle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 5ba5599..c0b5cf5 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -1589,7 +1589,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;