]> git.ipfire.org Git - thirdparty/elfutils.git/commit
Fix computations with (potentially) NULL pointer
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Mon, 13 Nov 2023 22:40:46 +0000 (22:40 +0000)
committerMark Wielaard <mark@klomp.org>
Tue, 14 Nov 2023 16:49:44 +0000 (17:49 +0100)
commitf1a381fb050650a9c15e15d0102967df3f0a6a03
treee220ade071b9ec98ca1ebecde49c8df52597fa62
parentb21b4dfc23c2c812147428a39999be9f3cb4615f
Fix computations with (potentially) NULL pointer

When map_address is NULL, computing map_address+offset is technically
undefined behavior, and triggers Clang/LLVM warning when using
-fsanitize=pointer-overflow.

Fix this by using uintptr_t to perform computations.

Signed-off-by: Shahriar "Nafi" Rouf <nafi@google.com>
Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
libelf/elf_begin.c