mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-03 22:31:34 +00:00
Fixing a potential deflate issues
This commit is contained in:
parent
d77e925a10
commit
e659543048
3 changed files with 8 additions and 3 deletions
|
|
@ -297,6 +297,11 @@ def decodePage(page, contentEncoding, contentType, percentDecode=True):
|
|||
if contentEncoding == "deflate":
|
||||
obj = zlib.decompressobj(-15)
|
||||
page = obj.decompress(page, MAX_CONNECTION_TOTAL_SIZE + 1)
|
||||
|
||||
# catch the deflate bomb before flush() forcefully expands it into RAM
|
||||
if len(page) > MAX_CONNECTION_TOTAL_SIZE:
|
||||
raise Exception("size too large")
|
||||
|
||||
page += obj.flush()
|
||||
if len(page) > MAX_CONNECTION_TOTAL_SIZE:
|
||||
raise Exception("size too large")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue