]> git.ipfire.org Git - thirdparty/libarchive.git/commit
warc: Fix undefined behaviour in deconst() function 1465/head
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Wed, 9 Dec 2020 16:17:22 +0000 (16:17 +0000)
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Wed, 9 Dec 2020 16:18:36 +0000 (16:18 +0000)
commit053e00de97dca3fb9fd53ea2bf26f3edf20b4233
treed50815f365b595a29e18da8438e061030362dbbf
parentc581b317cc71f964b2446b5534ebcc07be2f7cab
warc: Fix undefined behaviour in deconst() function

Creating a pointer by adding an offset to 0x1 is undefined behaviour and
results in an invalid pointer when running on CHERI systems. Use a
standards-compliant cast via uintptr_t instead.

This was found due to a crash while running the libarchive test suite on a
CHERI-RISC-V system.
libarchive/archive_read_support_format_warc.c