]> git.ipfire.org Git - thirdparty/zlib-ng.git/log
thirdparty/zlib-ng.git
8 years agoReplace remaining Z_NULL instances with NULL. 86/head
Mika Lindqvist [Mon, 13 Feb 2017 16:17:37 +0000 (18:17 +0200)] 
Replace remaining Z_NULL instances with NULL.

8 years agoMove Visual C++ workaround for CTZL to arch/x86. 84/head
Mika Lindqvist [Sun, 30 Oct 2016 12:12:42 +0000 (14:12 +0200)] 
Move Visual C++ workaround for CTZL to arch/x86.

8 years agoMSVC: Use _tzcnt_u32() if available.
Mika Lindqvist [Tue, 3 May 2016 18:03:54 +0000 (21:03 +0300)] 
MSVC: Use _tzcnt_u32() if available.

8 years agoMove instruction set specific crc32 code to arch directories.
Mika Lindqvist [Mon, 4 Apr 2016 14:01:39 +0000 (17:01 +0300)] 
Move instruction set specific crc32 code to arch directories.

8 years agoCMakeLists.txt: Cleanup.
Mika Lindqvist [Mon, 2 May 2016 11:14:01 +0000 (14:14 +0300)] 
CMakeLists.txt: Cleanup.

8 years agoAdd support for internal attribute
Mika Lindqvist [Thu, 28 Apr 2016 19:48:15 +0000 (22:48 +0300)] 
Add support for internal attribute
The advantage of this over hidden is for example that the compiler can
safely assume that pointers to functions declared internal can never be
passed externally. This allows the compiler to consider optimizations
otherwise impossible.

8 years agoRequire cmake 2.8.4.
Mika Lindqvist [Wed, 27 Apr 2016 13:43:55 +0000 (16:43 +0300)] 
Require cmake 2.8.4.
* Add duplicate check to add_intrinsics_option().

8 years agoCMakeLists.txt: use check_c_source_runs instead of check_c_source_compiles
René J.V. Bertin [Thu, 11 Jun 2015 20:08:19 +0000 (22:08 +0200)] 
CMakeLists.txt: use check_c_source_runs instead of check_c_source_compiles
to try to avoid using intrinsics and an instruction set the compiler
knows but the host CPU doesn't support.

8 years agoCMakeLists.txt : preliminary support for MSVC and ICC
René J.V. Bertin [Fri, 12 Jun 2015 13:13:49 +0000 (15:13 +0200)] 
CMakeLists.txt : preliminary support for MSVC and ICC

- select the CMAKE_BUILD_TYPE "Release" by default if none has been set,
  to ensure maximum generic optimisation possible on the host platform
- add WITH_NATIVE_INSTRUCTIONS to build with -march=native or its equivalent
  option with other compilers (when we identify those alternatives)
- NATIVEFLAG (-march=native) will be used instead of -msseN/-mpclmul when
  defined/requested

TODO: discuss whether -msseN/-mpclmul should be used only for the files that
need them instead of globally, while NATIVEFLAG can (is supposed to) be used
globally.

8 years agoCMakeLists.txt: better checking for Intel intrinsics.
René J.V. Bertin [Thu, 11 Jun 2015 17:20:41 +0000 (19:20 +0200)] 
CMakeLists.txt: better checking for Intel intrinsics.

The checks currently assume that instructions that build also execute.
This is not necessarily true: building with -msse4 on an AMD CPU (a C60)
that only has SSE4a leads to a crash in deflateInit2 when the compiler
apparently uses an unsupported instruction to set
s->hash_bits = memLevel + 7;

8 years agoarchitecture checks translated from configure to cmake; initial draft
René J.V. Bertin [Tue, 9 Jun 2015 21:59:37 +0000 (23:59 +0200)] 
architecture checks translated from configure to cmake; initial draft

8 years agoInitialize block_open state
Phil Vachon [Mon, 30 Jan 2017 14:32:29 +0000 (15:32 +0100)] 
Initialize block_open state

On deflation context creation, initialize the block_open state to 0 to
ensure that no uninitialized values are used.

8 years agoAdd block_open state for deflate_quick
Phil Vachon [Mon, 30 Jan 2017 14:28:25 +0000 (15:28 +0100)] 
Add block_open state for deflate_quick

By storing whether or not a block has been opened (or terminated), the
static trees used for the block and the end block markers can be emitted
appropriately.

8 years agoFix Partial Symbol Generation for QUICK deflate
Phil Vachon [Mon, 30 Jan 2017 14:20:20 +0000 (15:20 +0100)] 
Fix Partial Symbol Generation for QUICK deflate

When using deflate_quick() in a streaming fashion and the output buffer
runs out of space while the input buffer still has data, deflate_quick()
would emit partial symbols. Force the deflate_quick() loop to terminate
for a flush before any further processing is done, returning to the main
deflate() routine to do its thing.

8 years agozlib 1.2.11
Mark Adler [Sun, 15 Jan 2017 16:22:16 +0000 (08:22 -0800)] 
zlib 1.2.11

8 years agoPermit immediate deflateParams changes before any deflate input.
Mark Adler [Sun, 15 Jan 2017 16:22:16 +0000 (08:22 -0800)] 
Permit immediate deflateParams changes before any deflate input.

This permits deflateParams to change the strategy and level right
after deflateInit, without having to wait until a header has been
written. The parameters can be changed immediately up until the
first deflate call that consumes any input data.

8 years agoUpdate high water mark in deflate_stored.
Mark Adler [Sun, 15 Jan 2017 16:15:55 +0000 (08:15 -0800)] 
Update high water mark in deflate_stored.

This avoids unnecessary filling of bytes in the sliding window
buffer when switching from level zero to a non-zero level. This
also provides a consistent indication of deflate having taken
input for a later commit ...

8 years agoUpdate vestigial comment from very old Info-ZIP deflate.
Mark Adler [Sat, 14 Jan 2017 07:10:03 +0000 (23:10 -0800)] 
Update vestigial comment from very old Info-ZIP deflate.

8 years agoFix deflate stored bug when pulling last block from window.
Mark Adler [Fri, 13 Jan 2017 05:51:20 +0000 (21:51 -0800)] 
Fix deflate stored bug when pulling last block from window.

And some cosmetic cleanups.

8 years agoRemove files to be installed before copying them in Makefile.in.
Hans Kristian Rosbach [Mon, 13 Feb 2017 09:07:29 +0000 (10:07 +0100)] 
Remove files to be installed before copying them in Makefile.in.
Based on upstream commit c7d77756d01210790b6d87442eba83dcc586a305

8 years agoFix bug in gzwrite.c that produced corrupt gzip files.
Mark Adler [Tue, 3 Jan 2017 00:17:43 +0000 (16:17 -0800)] 
Fix bug in gzwrite.c that produced corrupt gzip files.

8 years agoFix bug in deflate_stored() for zero-length input.
Mark Adler [Mon, 2 Jan 2017 23:17:59 +0000 (15:17 -0800)] 
Fix bug in deflate_stored() for zero-length input.

8 years agoMinor edits and clarifications of comments.
Mark Adler [Mon, 2 Jan 2017 04:02:24 +0000 (20:02 -0800)] 
Minor edits and clarifications of comments.

8 years agoAvoid warnings on snprintf() return value.
Mark Adler [Sun, 1 Jan 2017 20:23:04 +0000 (12:23 -0800)] 
Avoid warnings on snprintf() return value.

8 years agozlib 1.2.9
Mark Adler [Sat, 31 Dec 2016 19:41:31 +0000 (11:41 -0800)] 
zlib 1.2.9

8 years agoAdd crc32_z() and adler32_z() functions with size_t lengths.
Mark Adler [Sun, 1 Jan 2017 00:57:26 +0000 (16:57 -0800)] 
Add crc32_z() and adler32_z() functions with size_t lengths.

8 years agoUse a uniform approach for the largest value of an unsigned type.
Mark Adler [Sat, 31 Dec 2016 16:49:17 +0000 (08:49 -0800)] 
Use a uniform approach for the largest value of an unsigned type.

8 years agoAvoid some random compiler warnings on various platforms.
Mark Adler [Sat, 31 Dec 2016 06:05:05 +0000 (22:05 -0800)] 
Avoid some random compiler warnings on various platforms.

8 years agoFix typo from 'Add deflateGetDictionary() function' causing compilation failure.
Hans Kristian Rosbach [Tue, 7 Feb 2017 09:18:18 +0000 (10:18 +0100)] 
Fix typo from 'Add deflateGetDictionary() function' causing compilation failure.

8 years agoDetect clang in cc version.
Mark Adler [Sat, 31 Dec 2016 02:58:46 +0000 (18:58 -0800)] 
Detect clang in cc version.

8 years agoAdd deflateGetDictionary() function.
Hans Kristian Rosbach [Mon, 6 Feb 2017 13:40:29 +0000 (14:40 +0100)] 
Add deflateGetDictionary() function.

Per request, but its utility is likely to be very limited. See the
comments in zlib.h.

Based on upstream ee7d7b5dda25c111e61e19ac7b476c26aa6f3020

8 years agoNo need to check for NULL argument to free().
Mark Adler [Fri, 30 Dec 2016 22:30:52 +0000 (14:30 -0800)] 
No need to check for NULL argument to free().

8 years agoAvoid use of DEBUG macro -- change to ZLIB_DEBUG.
Mark Adler [Wed, 29 Jul 2015 05:44:31 +0000 (22:44 -0700)] 
Avoid use of DEBUG macro -- change to ZLIB_DEBUG.

8 years agoAdd gzfwrite(), duplicating the interface of fwrite().
Mark Adler [Mon, 5 Dec 2016 02:29:43 +0000 (18:29 -0800)] 
Add gzfwrite(), duplicating the interface of fwrite().

8 years agoAdd gzfread(), duplicating the interface of fread().
Hans Kristian Rosbach [Mon, 6 Feb 2017 12:41:56 +0000 (13:41 +0100)] 
Add gzfread(), duplicating the interface of fread().

Based on upstream commit 44dfd831d24f9b627ab666cf0973b0dce98fabba

8 years agoDon't need to emit an empty fixed block when changing parameters.
Mark Adler [Sat, 3 Dec 2016 16:29:57 +0000 (08:29 -0800)] 
Don't need to emit an empty fixed block when changing parameters.

gzsetparams() was using Z_PARTIAL_FLUSH when it could use Z_BLOCK
instead. This commit uses Z_BLOCK, which avoids emitting an
unnecessary ten bits into the stream.

8 years agoClean up gz* function return values.
Mark Adler [Sat, 3 Dec 2016 16:18:56 +0000 (08:18 -0800)] 
Clean up gz* function return values.

In some cases the return values did not match the documentation,
or the documentation did not document all of the return values.
gzprintf() now consistently returns negative values on error,
which matches the behavior of the stdio fprintf() function.

8 years agoSpeed up deflation for level 0 (storing).
Mark Adler [Sat, 5 Nov 2016 15:43:29 +0000 (08:43 -0700)] 
Speed up deflation for level 0 (storing).

The previous code slid the window and the hash table and copied
every input byte three times in order to just write the data as
stored blocks with no compression. This commit minimizes sliding
and copying, especially for large input and output buffers.

Level 0 compression is now more than 20 times faster than before
the commit.

Most of the speedup is due to deferring hash table slides until
deflateParams() is called to change the compression level away
from 0. More speedup is due to copying directly from next_in to
next_out when the amounts of available input data and output space
permit it, avoiding the intermediate pending buffer. Additionally,
only the last 32K of the used input data is copied back to the
sliding window when large input buffers are provided.

8 years agoAssure that deflateParams() will not switch functions mid-block.
Mark Adler [Wed, 23 Nov 2016 07:29:19 +0000 (23:29 -0800)] 
Assure that deflateParams() will not switch functions mid-block.

This alters the specification in zlib.h, so that deflateParams()
will not change any parameters if there is not enough output space
in the event that a block is emitted in order to allow switching
the compression function.

8 years agoExplicitly ignore a return value in gzwrite.c.
Mark Adler [Tue, 22 Nov 2016 20:02:29 +0000 (12:02 -0800)] 
Explicitly ignore a return value in gzwrite.c.

8 years agoAdd uncompress2() function, which returns the input size used.
Mark Adler [Wed, 16 Nov 2016 03:45:01 +0000 (20:45 -0700)] 
Add uncompress2() function, which returns the input size used.

8 years agoMinor edits to the documentation in source file contents.
Mark Adler [Mon, 14 Nov 2016 17:19:25 +0000 (10:19 -0700)] 
Minor edits to the documentation in source file contents.

8 years agoFix crc corruption when using x86 PCLMULQDQ optimized crc.
Hans Kristian Rosbach [Thu, 2 Feb 2017 10:31:03 +0000 (11:31 +0100)] 
Fix crc corruption when using x86 PCLMULQDQ optimized crc.
We need to use crc_reset() instead of crc32() to do the reset.

8 years agoFix bugs in creating a very large gzip header.
Mark Adler [Sun, 6 Nov 2016 05:55:34 +0000 (22:55 -0700)] 
Fix bugs in creating a very large gzip header.

8 years agoAdd --debug (-d) option to ./configure to define ZLIB_DEBUG.
Mark Adler [Sun, 30 Oct 2016 16:33:25 +0000 (09:33 -0700)] 
Add --debug (-d) option to ./configure to define ZLIB_DEBUG.

8 years agoUse memcpy for stored blocks.
Mark Adler [Sun, 30 Oct 2016 16:25:32 +0000 (09:25 -0700)] 
Use memcpy for stored blocks.

This speeds up level 0 by about a factor of three, as compared to
the previous byte-at-a-time loop. We can do much better though. A
later commit avoids this copy for level 0 with large buffers,
instead copying directly from the input to the output. This commit
still speeds up storing incompressible data found when compressing
normally.

8 years agoFix some typos.
Mark Adler [Sun, 30 Oct 2016 15:36:13 +0000 (08:36 -0700)] 
Fix some typos.

8 years agoMake a noble effort at setting OS_CODE correctly.
Hans Kristian Rosbach [Wed, 1 Feb 2017 11:33:12 +0000 (12:33 +0100)] 
Make a noble effort at setting OS_CODE correctly.

Based on upstream commit ce12c5cd00628bf8f680c98123a369974d32df15

Original patch notes:
This updates the OS_CODE determination at compile time to match as
closely as possible the operating system mappings documented in
the PKWare APPNOTE.TXT version 6.3.4, section 4.4.2.2. That byte
in the gzip header is used by nobody for anything, as far as I can
tell. However we might as well try to set it appropriately.

8 years agoDo a more thorough check of the state for every stream call.
Mark Adler [Tue, 25 Oct 2016 03:11:41 +0000 (20:11 -0700)] 
Do a more thorough check of the state for every stream call.

This verifies that the state has been initialized, that it is the
expected type of state, deflate or inflate, and that at least the
first several bytes of the internal state have not been clobbered.

8 years agoDocument the rejection of 256-byte window requests in zlib.h.
Mark Adler [Mon, 24 Oct 2016 23:00:51 +0000 (16:00 -0700)] 
Document the rejection of 256-byte window requests in zlib.h.

8 years agoReject a window size of 256 bytes if not using the zlib wrapper.
Mark Adler [Mon, 24 Oct 2016 22:52:19 +0000 (15:52 -0700)] 
Reject a window size of 256 bytes if not using the zlib wrapper.

There is a bug in deflate for windowBits == 8 (256-byte window).
As a result, zlib silently changes a request for 8 to a request
for 9 (512-byte window), and sets the zlib header accordingly so
that the decompressor knows to use a 512-byte window. However if
deflateInit2() is used for raw deflate or gzip streams, then there
is no indication that the request was not honored, and the
application might assume that it can use a 256-byte window when
decompressing. This commit returns an error if the user requests
a 256-byte window when using raw deflate or gzip encoding.

8 years agoAvoid obfuscating use of default case in inftrees.c.
Mark Adler [Fri, 14 Oct 2016 20:30:18 +0000 (13:30 -0700)] 
Avoid obfuscating use of default case in inftrees.c.

8 years agoMove macro definition in deflate.c to where it is used.
Mark Adler [Fri, 14 Oct 2016 20:18:58 +0000 (13:18 -0700)] 
Move macro definition in deflate.c to where it is used.

This avoid defining a macro that is never used when not debugging.

8 years agoAvoid recursive gzgetc() macro call.
Mark Adler [Fri, 14 Oct 2016 20:16:07 +0000 (13:16 -0700)] 
Avoid recursive gzgetc() macro call.

Recursive macro calls are normally caught by the preprocessor and
avoided. This commit avoids the possibility of a problem entirely.

8 years agoMake globals in examples local to compilation unit.
Mark Adler [Fri, 14 Oct 2016 20:10:54 +0000 (13:10 -0700)] 
Make globals in examples local to compilation unit.

8 years agoAdd --warn option to ./configure, instead of environment variable.
Mark Adler [Wed, 12 Oct 2016 05:21:04 +0000 (22:21 -0700)] 
Add --warn option to ./configure, instead of environment variable.

8 years agoAdd inflateCodesUsed() function
Hans Kristian Rosbach [Wed, 1 Feb 2017 10:50:29 +0000 (11:50 +0100)] 
Add inflateCodesUsed() function
Based on upstream commit 5370d99a2affe0b040550cffbc0ba8fa790594b3

8 years agoClean up type conversions.
Mark Adler [Wed, 12 Oct 2016 05:15:50 +0000 (22:15 -0700)] 
Clean up type conversions.

Based on upstream 7096424f23df1b1813237fb5f8bc8f34cfcedd0c, but
modified heavily to match zlib-ng.

8 years agoNote the violation of the strict aliasing rule in crc32.c.
Mark Adler [Tue, 4 Oct 2016 05:33:26 +0000 (22:33 -0700)] 
Note the violation of the strict aliasing rule in crc32.c.

See the comment for more details. This is in response to an issue
raised as a result of a security audit of the zlib code by Trail
of Bits and TrustInSoft, in support of the Mozilla Foundation.

8 years agoAvoid pre-decrement of pointer in big-endian CRC calculation.
Mark Adler [Thu, 29 Sep 2016 03:20:25 +0000 (20:20 -0700)] 
Avoid pre-decrement of pointer in big-endian CRC calculation.

There was a small optimization for PowerPCs to pre-increment a
pointer when accessing a word, instead of post-incrementing. This
required prefacing the loop with a decrement of the pointer,
possibly pointing before the object passed. This is not compliant
with the C standard, for which decrementing a pointer before its
allocated memory is undefined. When tested on a modern PowerPC
with a modern compiler, the optimization no longer has any effect.
Due to all that, and per the recommendation of a security audit of
the zlib code by Trail of Bits and TrustInSoft, in support of the
Mozilla Foundation, this "optimization" was removed, in order to
avoid the possibility of undefined behavior.

8 years agoRemove offset pointer optimization in inftrees.c.
Mark Adler [Thu, 22 Sep 2016 06:35:50 +0000 (23:35 -0700)] 
Remove offset pointer optimization in inftrees.c.

inftrees.c was subtracting an offset from a pointer to an array,
in order to provide a pointer that allowed indexing starting at
the offset. This is not compliant with the C standard, for which
the behavior of a pointer decremented before its allocated memory
is undefined. Per the recommendation of a security audit of the
zlib code by Trail of Bits and TrustInSoft, in support of the
Mozilla Foundation, this tiny optimization was removed, in order
to avoid the possibility of undefined behavior.

8 years agoUse post-increment only in inffast.c.
Mark Adler [Thu, 22 Sep 2016 05:25:21 +0000 (22:25 -0700)] 
Use post-increment only in inffast.c.

An old inffast.c optimization turns out to not be optimal anymore
with modern compilers, and furthermore was not compliant with the
C standard, for which decrementing a pointer before its allocated
memory is undefined. Per the recommendation of a security audit of
the zlib code by Trail of Bits and TrustInSoft, in support of the
Mozilla Foundation, this "optimization" was removed, in order to
avoid the possibility of undefined behavior.

8 years agoAdd option to not compute or check check values.
Mark Adler [Wed, 21 Sep 2016 01:49:21 +0000 (18:49 -0700)] 
Add option to not compute or check check values.

The undocumented (except in these commit comments) function
inflateValidate(strm, check) can be called after an inflateInit(),
inflateInit2(), or inflateReset2() with check equal to zero to
turn off the check value (CRC-32 or Adler-32) computation and
comparison. Calling with check not equal to zero turns checking
back on. This should only be called immediately after the init or
reset function. inflateReset() does not change the state, so a
previous inflateValidate() setting will remain in effect.

This also turns off validation of the gzip header CRC when
present.

This should only be used when a zlib or gzip stream has already
been checked, and repeated decompressions of the same stream no
longer need to be validated.

8 years agoCorrect the size of the inflate state in the comments.
Mark Adler [Wed, 21 Sep 2016 00:27:28 +0000 (17:27 -0700)] 
Correct the size of the inflate state in the comments.

8 years agoUse TRIGGER_LEVEL in sse optimization too.
Mika Lindqvist [Wed, 25 May 2016 23:05:33 +0000 (02:05 +0300)] 
Use TRIGGER_LEVEL in sse optimization too.

8 years agoFix _off64_t check for clang.
Mika Lindqvist [Sun, 1 May 2016 23:02:09 +0000 (02:02 +0300)] 
Fix _off64_t check for clang.

8 years agoRemove dead code.
Mika Lindqvist [Sat, 30 Apr 2016 18:06:15 +0000 (21:06 +0300)] 
Remove dead code.

8 years agoFix shift of negative value in inflateMark().
Mika Lindqvist [Fri, 29 Apr 2016 21:24:42 +0000 (00:24 +0300)] 
Fix shift of negative value in inflateMark().

8 years agoInstruct make not to remove intermediate files.
Mika Lindqvist [Fri, 29 Apr 2016 12:38:31 +0000 (15:38 +0300)] 
Instruct make not to remove intermediate files.

8 years agoReplace Z_NULL with NULL. Fix incorrect uses of NULL/Z_NULL.
Mika Lindqvist [Mon, 25 Apr 2016 19:59:59 +0000 (22:59 +0300)] 
Replace Z_NULL with NULL. Fix incorrect uses of NULL/Z_NULL.

8 years agoFix 'depend' target.
Mika Lindqvist [Thu, 21 Apr 2016 16:03:46 +0000 (19:03 +0300)] 
Fix 'depend' target.

8 years agoFix debug build.
Mika Lindqvist [Mon, 18 Apr 2016 16:13:28 +0000 (19:13 +0300)] 
Fix debug build.

8 years agoUpdate -DGEN_TREES_H output to match trees.h
Mika Lindqvist [Mon, 18 Apr 2016 15:27:32 +0000 (18:27 +0300)] 
Update -DGEN_TREES_H output to match trees.h

8 years agoUpdate dependency information for zutil.c
Mika Lindqvist [Mon, 18 Apr 2016 08:42:45 +0000 (11:42 +0300)] 
Update dependency information for zutil.c

8 years agoVariable h was initialized twice on first iteration.
Mika Lindqvist [Thu, 14 Apr 2016 17:35:16 +0000 (20:35 +0300)] 
Variable h was initialized twice on first iteration.

8 years agoRevert "Loop on write() calls in gzwrite.c in case of non-blocking I/O."
Hans Kristian Rosbach [Mon, 30 Jan 2017 12:41:41 +0000 (13:41 +0100)] 
Revert "Loop on write() calls in gzwrite.c in case of non-blocking I/O."

This reverts commit 4811aa74806df01ac7e5a28c7a6b42bc6795b7a4.

Reverted because the code returns incorrect data.
Needs to be investigated and re-implemented.

8 years agoFix missing insert_string change from merge conflict
Hans Kristian Rosbach [Mon, 30 Jan 2017 12:18:07 +0000 (13:18 +0100)] 
Fix missing insert_string change from merge conflict

8 years agoMerge insert_string and bulk_insert_str.
Mika Lindqvist [Sun, 27 Mar 2016 12:02:54 +0000 (15:02 +0300)] 
Merge insert_string and bulk_insert_str.

** Partial merge of this commit, based on a8c94e9f5a3b9d3c62182bcf84e72304a3c1a6e5
Excludes changes to fill_window_sse.c, changes to fill_window_c() in deflate.c
and several unrelated changes in the commit.

8 years agoUse bulk_insert_str when adding more than one byte.
Mika Lindqvist [Fri, 25 Mar 2016 15:56:41 +0000 (17:56 +0200)] 
Use bulk_insert_str when adding more than one byte.

** Partial merge of this commit, based on f8ad48ab17571c730b743c925f0e13ff83cf487f
Excluding changes to fill_window_sse.c, deflate.c and deflate_p.h

8 years agoUse TRIGGER_LEVEL instead of hard-coded '6'.
Mika Lindqvist [Wed, 24 Jun 2015 22:01:00 +0000 (01:01 +0300)] 
Use TRIGGER_LEVEL instead of hard-coded '6'.

** Only merged part of this commit, based on 9460967fcfde4d83574f82eabe2a2bc91a9c351a

8 years agoUpdate .gitignore
Mika Lindqvist [Thu, 11 Jun 2015 02:22:01 +0000 (05:22 +0300)] 
Update .gitignore

8 years agoignore KDevelop statefiles
René J.V. Bertin [Tue, 9 Jun 2015 22:01:44 +0000 (00:01 +0200)] 
ignore KDevelop statefiles

8 years agocpuid for msvc
Mat Berchtold [Thu, 29 Oct 2015 14:38:02 +0000 (15:38 +0100)] 
cpuid for msvc

8 years agoAdd a.exe to cleanup list.
Mika Lindqvist [Sun, 22 Nov 2015 15:31:04 +0000 (17:31 +0200)] 
Add a.exe to cleanup list.

8 years agolocal -> static
Mika Lindqvist [Sun, 22 Nov 2015 15:15:58 +0000 (17:15 +0200)] 
local -> static

* local -> static
* Normalize and cleanup line-endings
* Fix warnings under Visual Studio.
* Whitespace cleanup

***
This patch has been edited to merge cleanly and to exclude type changes.
Based on 8d7a7c3b82c6e38734bd504dac800b148ab410d0 "Type Cleanup"

9 years agoMerge pull request #74 from Majlen/develop
Hans Kristian Rosbach [Wed, 20 Jul 2016 12:28:43 +0000 (14:28 +0200)] 
Merge pull request #74 from Majlen/develop

Using correct format specifiers

9 years agoUsing correct format specifiers 74/head
Milan Ševčík [Sun, 17 Jul 2016 20:44:25 +0000 (22:44 +0200)] 
Using correct format specifiers

Fixes bug #73

9 years agoMerge pull request #72 from mtl1979/duphead
Hans Kristian Rosbach [Thu, 7 Jul 2016 13:41:52 +0000 (15:41 +0200)] 
Merge pull request #72 from mtl1979/duphead

Don't update prev if old head is same as new.

9 years agoDon't update prev if old head is same as new. 72/head
Mika Lindqvist [Sun, 19 Jun 2016 12:21:46 +0000 (15:21 +0300)] 
Don't update prev if old head is same as new.

9 years agoMerge pull request #70 from jibsen/fix-win-clang
Hans Kristian Rosbach [Tue, 28 Jun 2016 19:51:59 +0000 (21:51 +0200)] 
Merge pull request #70 from jibsen/fix-win-clang

Do not define __builtin_ctzl for Clang on MSVC

9 years agoDo not define __builtin_ctzl for Clang on MSVC 70/head
Joergen Ibsen [Mon, 13 Jun 2016 11:01:18 +0000 (13:01 +0200)] 
Do not define __builtin_ctzl for Clang on MSVC

Clang targeting MSVC and Clang/C2 provide __builtin_ctzl.

9 years agoOnly run tests requiring zlib-compat if zlib-ng was compiled with it.
Hans Kristian Rosbach [Thu, 28 Apr 2016 12:59:20 +0000 (14:59 +0200)] 
Only run tests requiring zlib-compat if zlib-ng was compiled with it.

This also reveals that minigzip without zlib-compat is vulnerable
to one or more of the tests.

9 years agoFix spelling in travis config
Hans Kristian Rosbach [Thu, 28 Apr 2016 12:23:33 +0000 (14:23 +0200)] 
Fix spelling in travis config

9 years agoMake travis test --without-optimizations and --without-new-strategies codepaths as...
Hans Kristian Rosbach [Thu, 28 Apr 2016 12:20:46 +0000 (14:20 +0200)] 
Make travis test --without-optimizations and --without-new-strategies codepaths as well.

9 years agoBoth travis builds using configure should do zlib-compat
Hans Kristian Rosbach [Thu, 28 Apr 2016 12:15:02 +0000 (14:15 +0200)] 
Both travis builds using configure should do zlib-compat

9 years agoTravis should compile and test the zlib-compat code as well
Hans Kristian Rosbach [Thu, 28 Apr 2016 12:12:41 +0000 (14:12 +0200)] 
Travis should compile and test the zlib-compat code as well

9 years agoFix the remaining warnings due to conflicting defines of ZLIB_INTERNAL
Hans Kristian Rosbach [Thu, 28 Apr 2016 12:06:46 +0000 (14:06 +0200)] 
Fix the remaining warnings due to conflicting defines of ZLIB_INTERNAL

9 years agoAdd test for CVE-2004-0797
Daniel Axtens [Wed, 29 Apr 2015 06:20:37 +0000 (16:20 +1000)] 
Add test for CVE-2004-0797

CVE-2004-0797[0] occured when an error was detected but no action
was taken --- that is, execution was allowed to continue.

One of the tests for CVE-2005-2096 actually hit the code path that
was fixed in the patch for CVE-2004-0797.

This occured because all the fuzzing was done on zlib 1.2.1, and
zlib 1.2.2 fixed this bug but not the 2005 CVEs. It was detected by
running the test cases against zlib 1.2.2.

The relevant bits of the zlib 1.2.2 patch are [1] and [2].

[0] http://www.kb.cert.org/vuls/id/238678
[1] https://github.com/madler/zlib/commit/7a6955760ba950eb82f57929f8f6c9847c65f0af?diff=unified#diff-154f1240658ec1e9f5c90024002d749aR437
[2] https://github.com/madler/zlib/commit/7a6955760ba950eb82f57929f8f6c9847c65f0af?diff=unified#diff-327188edf18799ffbb5a51cc69f797e8R864

Signed-off-by: Daniel Axtens <dja@axtens.net>
9 years agoAdd test cases for CVE-2005-1849 and CVE-2005-2096
Daniel Axtens [Wed, 29 Apr 2015 04:56:57 +0000 (14:56 +1000)] 
Add test cases for CVE-2005-1849 and CVE-2005-2096

CVE-2005-1849[0] is an overflow of a fixed size buffer defined in
inftrees.h

CVE-2005-2096[1] is an overflow caused by insufficient input
validation of code trees[2].

This makes sure we don't accidentally reintroduce them.

zlib-1.2.1 was download and fuzz tested using AFL[3].  The crashing
cases were discovered. A patch for 1849 was then applied, and used to
determine which cases hit only that bug, and which ones hit 2096.

[0] http://seclists.org/bugtraq/2005/Jul/451
[1] http://seclists.org/bugtraq/2005/Jul/53
[2] https://bug299445.bugzilla.mozilla.org/attachment.cgi?id=188021
[3] http://lcamtuf.coredump.cx/afl/

Signed-off-by: Daniel Axtens <dja@axtens.net>
9 years agoAdd test for CVE-2002-0059
Daniel Axtens [Mon, 27 Apr 2015 06:17:21 +0000 (16:17 +1000)] 
Add test for CVE-2002-0059

CVE-2002-0059 was a double free in inflation. [0]

This makes sure we don't accidentally reintroduce it.

zlib-1.1.3 was download and fuzz tested using AFL[1].
This crashing case (test.gz) was discovered, and using gdb it was
confirmed to be a double free in the expected place.

The test script looks for a normal error exit (status code 1),
and fails if any other code is returned.

[0] http://www.cvedetails.com/cve/CVE-2002-0059/
[1] http://lcamtuf.coredump.cx/afl/

Signed-off-by: Daniel Axtens <dja@axtens.net>