]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
http: fix infinite loop hang with invalid gzip data 2921/head
authorJeff Hunter <jeff@jeffhunter.me>
Tue, 9 Jun 2020 20:18:29 +0000 (13:18 -0700)
committerPierce Lopez <pierce.lopez@gmail.com>
Sat, 26 Sep 2020 21:54:07 +0000 (17:54 -0400)
tornado/http1connection.py

index ac7170f7d05878aec04abb3e51e48b9b849b4e2f..835027b479b7276dfd2c4ec1fc76af36901c1849 100644 (file)
@@ -737,6 +737,10 @@ class _GzipMessageDelegate(httputil.HTTPMessageDelegate):
                     if ret is not None:
                         await ret
                 compressed_data = self._decompressor.unconsumed_tail
+                if compressed_data and not decompressed:
+                    raise httputil.HTTPInputError(
+                        "encountered unconsumed gzip data without making progress"
+                    )
         else:
             ret = self._delegate.data_received(chunk)
             if ret is not None: