]> git.ipfire.org Git - thirdparty/zlib-ng.git/commit
Remove offset pointer optimization in inftrees.c.
authorMark Adler <madler@alumni.caltech.edu>
Thu, 22 Sep 2016 06:35:50 +0000 (23:35 -0700)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 31 Jan 2017 10:08:23 +0000 (11:08 +0100)
commitdd96293619bd4ebd755c8d3d36753b927877cfa4
tree028c993b7bb3403dc389afb5b5952eeaceb6498e
parent5a83169452c2e204cbc2ec8bf6a14f24d02c3888
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.
inftrees.c