]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdw: check memory access in get_(u|s)leb128
authorAleksei Vetrov <vvvvvv@google.com>
Mon, 13 Feb 2023 20:10:05 +0000 (20:10 +0000)
committerMark Wielaard <mark@klomp.org>
Tue, 14 Feb 2023 15:37:35 +0000 (16:37 +0100)
commite444d60a341b7b9bc3ae763a843d3e7190234ca9
tree83c930311b14ee673593d946375a9f206a07b7ec
parentf2c522567ad63ac293535fba9704895e685ab5bc
libdw: check memory access in get_(u|s)leb128

__libdw_get_uleb128 and __libdw_get_sleb128 should check if addrp has
already reached the end before unrolling the first step. It is done by
moving __libdw_max_len to the beginning of the function, which can
notice, that addrp is beyond the end. Then we just check the result of
this function.

Signed-off-by: Aleksei Vetrov <vvvvvv@google.com>
libdw/memory-access.h
tests/leb128.c