Skip to content
Commit 8ab6e29c authored by Chris Friedt's avatar Chris Friedt Committed by Benjamin Cabé
Browse files

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: default avatarChris Friedt <cfriedt@tenstorrent.com>
parent f81293d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment