Skip to content

Commit

Permalink
switch to zlib 1.2.13
Browse files Browse the repository at this point in the history
Fix a bug when getting a gzip header extra field with inflateGetHeader(). This remedies CVE-2022-37434.
Fix a bug in block type selection when Z_FIXED used. Now the smallest block type is selected, for better compression.
Fix a configure issue that discarded the provided CC definition.
Correct incorrect inputs provided to the CRC functions. This mitigates a bug in Java.
Repair prototypes and exporting of the new CRC functions.
Fix inflateBack to detect invalid input with distances too far.
Fix a deflate bug when using the Z_FIXED strategy that can result in out-of-bound accesses.
Fix a deflate bug when the window is full in deflate_stored().
Speed up CRC-32 computations by a factor of 1.5 to 3.
Use the hardware CRC-32 instruction on ARMv8 processors.
Speed up crc32_combine() with powers of x tables.
Add crc32_combine_gen() and crc32_combine_op() for fast combines.
  • Loading branch information
mosfet80 committed Jun 20, 2023
1 parent b94392d commit 8741da2
Show file tree
Hide file tree
Showing 77 changed files with 15,987 additions and 4,558 deletions.
2 changes: 1 addition & 1 deletion contrib/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()
project(zlib C)
SET (ZLIB_VERSION_MAJOR 1)
SET (ZLIB_VERSION_MINOR 2)
SET (ZLIB_VERSION_PATCH 11)
SET (ZLIB_VERSION_PATCH 13)
SET (ZLIB_VERSION ${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH})
SET (ZLIB_SOVERSION 1)
SET (PROJECT_VERSION "${ZLIB_VERSION}")
Expand Down
1,590 changes: 1,590 additions & 0 deletions contrib/zlib/ChangeLog

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions contrib/zlib/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright notice:

(C) 1995-2022 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

Jean-loup Gailly Mark Adler
[email protected] [email protected]
6 changes: 3 additions & 3 deletions contrib/zlib/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
Expand Down Expand Up @@ -65,7 +65,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)

/* ===========================================================================
*/
int ZEXPORT compress (dest, destLen, source, sourceLen)
int ZEXPORT compress(dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
Expand All @@ -78,7 +78,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
uLong ZEXPORT compressBound (sourceLen)
uLong ZEXPORT compressBound(sourceLen)
uLong sourceLen;
{
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
Expand Down
23 changes: 1 addition & 22 deletions contrib/zlib/contrib/README.contrib
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
All files under this contrib directory are UNSUPPORTED. There were
All files under this contrib directory are UNSUPPORTED. They were
provided by users of zlib and were not tested by the authors of zlib.
Use at your own risk. Please contact the authors of the contributions
for help about these, not the zlib authors. Thanks.
Expand All @@ -8,14 +8,6 @@ ada/ by Dmitriy Anisimkov <[email protected]>
Support for Ada
See http://zlib-ada.sourceforge.net/

amd64/ by Mikhail Teterin <[email protected]>
asm code for AMD64
See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393

asm686/ by Brian Raiter <[email protected]>
asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
See http://www.muppetlabs.com/~breadbox/software/assembly.html

blast/ by Mark Adler <[email protected]>
Decompressor for output of PKWare Data Compression Library (DCL)

Expand All @@ -32,9 +24,6 @@ gcc_gvmat64/by Gilles Vollant <[email protected]>
infback9/ by Mark Adler <[email protected]>
Unsupported diffs to infback to decode the deflate64 format

inflate86/ by Chris Anderson <[email protected]>
Tuned x86 gcc asm code to replace inflate_fast()

iostream/ by Kevin Ruland <[email protected]>
A C++ I/O streams interface to the zlib gz* functions

Expand All @@ -45,16 +34,6 @@ iostream3/ by Ludwig Schwardt <[email protected]>
and Kevin Ruland <[email protected]>
Yet another C++ I/O streams interface

masmx64/ by Gilles Vollant <[email protected]>
x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
replace longest_match() and inflate_fast(), also masm x86
64-bits translation of Chris Anderson inflate_fast()

masmx86/ by Gilles Vollant <[email protected]>
x86 asm code to replace longest_match() and inflate_fast(),
for Visual C++ and MASM (32 bits).
Based on Brian Raiter (asm686) and Chris Anderson (inflate86)

minizip/ by Gilles Vollant <[email protected]>
Mini zip and unzip based on zlib
Includes Zip64 support by Mathias Svensson <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion contrib/zlib/contrib/blast/blast.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow,
* use by the application to pass an input descriptor to infun(), if desired.
*
* If left and in are not NULL and *left is not zero when blast() is called,
* then the *left bytes are *in are consumed for input before infun() is used.
* then the *left bytes at *in are consumed for input before infun() is used.
*
* The output function is invoked: err = outfun(how, buf, len), where the bytes
* to be written are buf[0..len-1]. If err is not zero, then blast() returns
Expand Down
2 changes: 1 addition & 1 deletion contrib/zlib/contrib/blast/test.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
AIAIAIAIAIAIA
AIAIAIAIAIAIA
2 changes: 1 addition & 1 deletion contrib/zlib/contrib/delphi/ZLib.pas
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
const OutBuf: Pointer; BufSize: Integer);

const
zlib_version = '1.2.11';
zlib_version = '1.2.13';

type
EZlibError = class(Exception);
Expand Down
64 changes: 32 additions & 32 deletions contrib/zlib/contrib/dotzlib/DotZLib.build
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="utf-8" ?>
<project name="DotZLib" default="build" basedir="./DotZLib">
<description>A .Net wrapper library around ZLib1.dll</description>

<property name="nunit.location" value="c:/program files/NUnit V2.1/bin" />
<property name="build.root" value="bin" />

<property name="debug" value="true" />
<property name="nunit" value="true" />

<property name="build.folder" value="${build.root}/debug/" if="${debug}" />
<property name="build.folder" value="${build.root}/release/" unless="${debug}" />

<target name="clean" description="Remove all generated files">
<delete dir="${build.root}" failonerror="false" />
</target>

<target name="build" description="compiles the source code">

<mkdir dir="${build.folder}" />
<csc target="library" output="${build.folder}DotZLib.dll" debug="${debug}">
<references basedir="${nunit.location}">
<includes if="${nunit}" name="nunit.framework.dll" />
</references>
<sources>
<includes name="*.cs" />
<excludes name="UnitTests.cs" unless="${nunit}" />
</sources>
<arg value="/d:nunit" if="${nunit}" />
</csc>
</target>

<?xml version="1.0" encoding="utf-8" ?>
<project name="DotZLib" default="build" basedir="./DotZLib">
<description>A .Net wrapper library around ZLib1.dll</description>

<property name="nunit.location" value="c:/program files/NUnit V2.1/bin" />
<property name="build.root" value="bin" />

<property name="debug" value="true" />
<property name="nunit" value="true" />

<property name="build.folder" value="${build.root}/debug/" if="${debug}" />
<property name="build.folder" value="${build.root}/release/" unless="${debug}" />

<target name="clean" description="Remove all generated files">
<delete dir="${build.root}" failonerror="false" />
</target>

<target name="build" description="compiles the source code">

<mkdir dir="${build.folder}" />
<csc target="library" output="${build.folder}DotZLib.dll" debug="${debug}">
<references basedir="${nunit.location}">
<includes if="${nunit}" name="nunit.framework.dll" />
</references>
<sources>
<includes name="*.cs" />
<excludes name="UnitTests.cs" unless="${nunit}" />
</sources>
<arg value="/d:nunit" if="${nunit}" />
</csc>
</target>

</project>
116 changes: 58 additions & 58 deletions contrib/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("DotZLib")]
[assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Henrik Ravn")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.0.*")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("DotZLib")]
[assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Henrik Ravn")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.0.*")]

//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
Loading

0 comments on commit 8741da2

Please sign in to comment.