Merge pull request #770 in SNORT/snort3 from modern_zlib to master
Squashed commit of the following:
commit
152f75000bddbafd0180352d4208cb4eae1c3d70
Author: Michael Altizer <mialtize@cisco.com>
Date: Mon Jan 9 21:38:56 2017 -0500
http_server: Do not copy zlib z_stream object after initialization
More recent versions of zlib now include a backreference from the
stream state to the stream object for sanity checking, which becomes
invalid if the z_stream object is copied by value. Future functions
called using the copied object will fail due to the sanity checks.
http_server was doing this for no obvious reason, so this patch fixes it.
commit
25eef766344d6c24f096f3f0ecc175b244a8ef41
Author: Michael Altizer <mialtize@cisco.com>
Date: Mon Jan 9 21:31:29 2017 -0500
so_manager: Use the lowest legal value for windowBits in deflateInit2()
The current value of -8 is not legal due to a bug in deflate with
windowBits == 8 (256-byte window). Newer versions of zlib are
actively enforcing this restriction when headers are being excluded as
Snort does and cause deflateInit2() to fail. It used to silently change
the windowBits to 9, so now do so explicitly.
See also:
https://github.com/madler/zlib/commit/
049578f0a1849f502834167e233f4c1d52ddcbcc
as well as the zlib manual (http://www.zlib.net/manual.html)