A python example:<p><pre><code>    def decompress(data, maxsize=262144):

        dec = zlib.decompressobj()
        data = dec.decompress(data, maxsize)
        if dec.unconsumed_tail:
            raise ValueError(&quot;Possible zip Bomb&quot;)
        del dec

        return data</code></pre>