posix: shm: ensure addend is less than INTPTR_MAX
Although it's quite unlikely that we will see shared memory
objects in practice that are greater than 2GiB, there is a
possibility of integer overflow when comparing intptr_t and
size_t, since the former is signed and the latter is unsigned.
Explicitly check to ensure that the addend is less than
INTPTR_MAX before subtraction.
This fixes CID 487734
Signed-off-by:
Chris Friedt <cfriedt@tenstorrent.com>
Loading
Please sign in to comment