Skip to content

Commit

Permalink
paxelf: use correct format string
Browse files Browse the repository at this point in the history
On 32-bit platforms, mmap() larger than 2GB may fail.

This patch ensures that the correct size is printed and provides
parity with commit 90a0c6a.

Signed-off-by: Zach van Rijn <me@zv.io>
Closes: #18
Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
zv-io authored and thesamesam committed Sep 22, 2024
1 parent 15a415c commit f80b5ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paxelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ elfobj *_readelf_fd(const char *filename, int fd, size_t len, int read_only)

buffer = mmap(0, len, PROT_READ | (read_only ? 0 : PROT_WRITE), (read_only ? MAP_PRIVATE : MAP_SHARED), fd, 0);
if (buffer == MAP_FAILED) {
warn("mmap on '%s' of %li bytes failed :(", filename, (unsigned long)len);
warn("mmap on '%s' of %zu bytes failed :(", filename, len);
return NULL;
}

Expand Down

0 comments on commit f80b5ef

Please sign in to comment.