summaryrefslogtreecommitdiff
path: root/HTMLparser.c
diff options
context:
space:
mode:
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2022-12-01 12:58:11 +0000
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2022-12-01 15:14:40 +0000
commitc62c0d82ccacc2000c45f211166f008687fb97a0 (patch)
tree15c82fa99fda84798bfae6d665bc353909948a35 /HTMLparser.c
parentc7a9b85cbb73ba6f23282b0b15ffe0178931a161 (diff)
downloadlibxml2-c62c0d82ccacc2000c45f211166f008687fb97a0.tar.gz
Correctly relocate internal pointers after realloc()
Adding an offset to a deallocated pointer and assuming that it can be dereferenced is undefined behaviour. When running libxml2 on CHERI-enabled systems such as Arm Morello this results in the creation of an out-of-bounds pointer that cannot be dereferenced and therefore crashes at runtime. The effect of this UB is not just limited to architectures such as CHERI, incorrect relocation of pointers after realloc can in fact cause FORTIFY_SOURCE errors with recent GCC: https://developers.redhat.com/articles/2022/09/17/gccs-new-fortification-level
Diffstat (limited to 'HTMLparser.c')
0 files changed, 0 insertions, 0 deletions