summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 22f84a8..ce828da 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -68,7 +68,10 @@ w_more(int c, WFILE *p)
if (p->str == NULL)
return; /* An error already occurred */
size = PyString_Size(p->str);
- newsize = size + 1024;
+ newsize = size + size + 1024;
+ if (newsize > 32*1024*1024) {
+ newsize = size + 1024*1024;
+ }
if (_PyString_Resize(&p->str, newsize) != 0) {
p->ptr = p->end = NULL;
}