Zlib – a spiffy yet delicately unobtrusive compression library

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
  • ZLib

    A massively spiffy yet delicately unobtrusive compression library.

    I feel obliged to point this out here:

    Do not build zlib with the optimized assembly code.

    The "hand-optimized" assembly code is a contribution and does not receive support by the library authors. There are bugs in there and it will read/write out of bounds given just the right data - we've been bit by it. Note [0].

    The Makefiles get this right - they stay far away from any hand-rolled assembly. But the contributed Visual Studio solutions default to building with the ASM: [1] [2]. *Make sure to choose Debug/ReleaseWithoutAsm.

    You can check any zlib build for whether it was built with ASM via (zlibCompileFlags() & (1 << 9)): [3]

    Needless to say, an OOB in a library as fundamental (and as user-data-facing) as zlib is a serious vulnerability. We didn't find any distribution or major software that uses a vulnerable zlib build, but if you are on Windows you might accidentally make one. Beware!

    [0]: https://github.com/madler/zlib/blob/master/inffast.c#L12

    [1]: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da...

    [2]: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da...

    [3]: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da...

  • zlib

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • zlib

    Cloudflare fork of zlib with massive performance improvements (by cloudflare)

  • zlib-ng

    zlib replacement with optimizations for "next generation" systems.

  • libdeflate

    Heavily optimized library for DEFLATE/zlib/gzip compression and decompression

    Going away from Zlib proper but staying with its format, there’s libdeflate[1], an implementation that’s substantially faster on modern machines but can’t stream, and of course Zopfli[2], a glacially slow compressor that’s somewhat better (and occasionally much more so).

    [1] https://github.com/ebiggers/libdeflate

    [2] https://github.com/google/zopfli

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts