[CVE-2016-9840] Remove offset pointer optimization in inftrees.c. 45/272045/1
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 7 Mar 2022 10:17:13 +0000 (19:17 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 7 Mar 2022 10:17:17 +0000 (19:17 +0900)
commit66326afdeb10bedeadecb52b3bc7fe188434f70f
treef3b8374a529fae25f31ed1ab16e3aaa99e199377
parent9742430a12b65035381f4a3c941769bcf9b228ca
[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: I2477458b9b90049af941c23384001c3de5433b00
win32port/zlib/inftrees.c