We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efcb8c5 commit 412032bCopy full SHA for 412032b
Lib/plistlib.py
@@ -73,6 +73,9 @@
73
PlistFormat = enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__)
74
globals().update(PlistFormat.__members__)
75
76
+# Data larger than this will be read in chunks, to prevent extreme
77
+# overallocation.
78
+_SAFE_BUF_SIZE = 1 << 20
79
80
class UID:
81
def __init__(self, data):
@@ -509,7 +512,7 @@ def _get_size(self, tokenL):
509
512
return tokenL
510
513
511
514
def _read(self, size):
- cursize = min(size, 1 << 20)
515
+ cursize = min(size, _SAFE_BUF_SIZE)
516
data = self._fp.read(cursize)
517
while True:
518
if len(data) != cursize:
0 commit comments