Skip to content
Commit 499b7493 authored by Chin Liang See's avatar Chin Liang See Committed by Tom Rini
Browse files

lib: zlib: Remove offset pointer optimization in inftrees.c

This fixes the CVE-2016-9840. Commit imported from [1].

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.

[1]: https://github.com/madler/zlib/commit/6a043145ca6e9c55184013841a67b2fef87e44c0



Signed-off-by: default avatarMark Adler <madler@alumni.caltech.edu>
Signed-off-by: default avatarChin Liang See <chin.liang.see@intel.com>
Signed-off-by: default avatarLey Foon Tan <ley.foon.tan@intel.com>
parent b4d14bc8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment