Author: Armin Rigo <[email protected]>
Branch: py3.6
Changeset: r97764:466d2e12ff4b
Date: 2019-10-12 12:18 +0200
http://bitbucket.org/pypy/pypy/changeset/466d2e12ff4b/

Log:    #3088: don't grow the lzma.decompress() buffer past max_length

diff --git a/lib_pypy/_lzma.py b/lib_pypy/_lzma.py
--- a/lib_pypy/_lzma.py
+++ b/lib_pypy/_lzma.py
@@ -634,6 +634,8 @@
                         break
                     # ran out of space in the output buffer, let's grow it
                     bufsiz += (bufsiz >> 3) + 6
+                    if max_length > 0 and bufsiz > max_length:
+                        bufsiz = max_length
                     next_out = m.realloc(orig_out, bufsiz)
                     if next_out == ffi.NULL:
                         # realloc unsuccessful
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to