[CVE-2016-9841] Use post-increment only in inffast.c. 66/256466/1
authorJinWang An <jinwang.an@samsung.com>
Mon, 5 Apr 2021 05:21:24 +0000 (14:21 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 5 Apr 2021 05:23:32 +0000 (14:23 +0900)
commit08641b6465ffd2c67eaa0131fcf6a3ec24484f80
treeea73d5bcb4a9b3065efd025a13087e0b9be04c25
parentfb0e1555c426576c440f1abc3691beaf920b27db
[CVE-2016-9841] 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.

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