
On Sun, Sep 11, 2022 at 04:46:37PM +0800, Jit Loon Lim wrote:
From: Chin Liang See chin.liang.see@intel.com
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.
This is a backport of commit 9aaec95e82117 from the upstream zlib project.
Signed-off-by: Mark Adler madler@alumni.caltech.edu Signed-off-by: Chin Liang See chin.liang.see@intel.com Signed-off-by: Jit Loon Lim jit.loon.lim@intel.com
I was about to apply this with a slightly updated commit message and then I discovered that this causes at least the following tests to fail in CI on sandbox: FAILED test/py/tests/test_fit.py::test_fit - AssertionError: Kernel not loaded FAILED test/py/tests/test_ut.py::test_ut[ut_dm_dm_test_video_bmp16] - ValueError: U-Boot exi... FAILED test/py/tests/test_ut.py::test_ut[ut_dm_dm_test_video_bmp24] - ValueError: U-Boot exi... FAILED test/py/tests/test_ut.py::test_ut[ut_dm_dm_test_video_bmp24_32] - ValueError: U-Boot ... FAILED test/py/tests/test_fs/test_squashfs/test_sqfs_load.py::test_sqfs_load - AssertionError FAILED test/py/tests/test_fs/test_squashfs/test_sqfs_ls.py::test_sqfs_ls - AssertionError Given that the sqfs ones are saying the data is corrupt, I'm unsure if the problem is the code or the patch here.