Add warning to unpack_zip_archive_in_memory function.

Change-Id: Ia8dfd95df82a5ba7f72426be65f9521ed161d5a8
This commit is contained in:
Idan Narotzki 2017-07-25 10:34:36 +00:00
parent 6d8356b0fb
commit 9337f11bca
1 changed files with 5 additions and 0 deletions

View File

@ -110,6 +110,11 @@ def unpack_zip_archive_in_memory(context, af, fd):
:param fd: file
:return io.BytesIO object - simple stream of in-memory bytes, None
"""
# Warning: usage of this function is potentially harmful, because it
# doesn't limit how much data it writes to ram. Careless usage in artifact
# types may cause denial of the service.
# Thus it should be used only with blobs with reduced max_blob_size
flobj = io.BytesIO(fd.read())
while True:
data = fd.read(65536)