[CVE-2016-9840] Remove offset pointer optimization in inftrees.c. 37/253437/1
authorMark Adler <madler@alumni.caltech.edu>
Thu, 22 Sep 2016 06:35:50 +0000 (23:35 -0700)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 10 Feb 2021 05:07:35 +0000 (14:07 +0900)
commit6d7df5b1c0e3c46f82b48b57a0019bb94f95d126
tree5d361d1fa9e8c4dc44099561a2ab1a8b9fce3bb2
parente2f48de7d886abde5d7572ae09117aa49f319792
[CVE-2016-9840] 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.

Change-Id: I03e14177f9b11fc347bdff7110be44d456b09497
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
zlib/inftrees.c