]> git.ipfire.org Git - thirdparty/dhcpcd.git/commit
common: Cast via uintptr_t rather than unsigned long in UNCONST (#581) master
authorJessica Clarke <jrtc27@jrtc27.com>
Fri, 9 Jan 2026 21:56:25 +0000 (21:56 +0000)
committerGitHub <noreply@github.com>
Fri, 9 Jan 2026 21:56:25 +0000 (21:56 +0000)
commit2c1db0494c401c3d8698ae3b57f352b798ac0eaa
treef5bb0628fa59f07c313e517f20c49c83ae5ccbde
parentcd0b26953cc88b179dade20f585e4c5e1f7c1062
common: Cast via uintptr_t rather than unsigned long in UNCONST (#581)

On ILP32 and LP64 systems, unsigned long is sufficient to round-trip
pointers, but on LLP64 systems it is too small, and on systems like
CHERI where pointers are capabilities, it does not propagate capability
metadata, and casting back to a pointer to yield a pointer that cannot
be dereferenced.

Instead, cast via uintptr_t to ensure we always use an integral type
that can losslessly round-trip pointers.
src/common.h