Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose zlib limited output buffer size functionality. #592

Closed
wants to merge 1 commit into from

Commits on Feb 12, 2015

  1. Add zlib limited output buffer size functionality

    This functionality may be useful for compressed streams with high
    compression ratio (in case of gzip it may be up to x1000), when
    small amount of compressed data will produce large amount of
    uncompressed output. This may lead to DoS attacks, because
    server easily goes out of memory.
    
    Example of such high compression ratio stream:
    ```
    dd if=/dev/zero of=sparse.bin bs=1MB count=100 # 100mb of zeroes
    gzip sparse.bin  # 95kb sparse.bin.gz
    $ erl
    > {ok, Compressed} = file:read_file("sparse.bin.gz"),
    > 97082 = size(Compressed),
    > Uncompressed = zlib:gunzip(Compressed),
    > 100000000 = iolist_size(Uncompressed).
    ```
    seriyps committed Feb 12, 2015
    Configuration menu
    Copy the full SHA
    b24651c View commit details
    Browse the repository at this point in the history