diff --git a/src/ipc/shmget.c b/src/ipc/shmget.c index 61fb11d97b93e54fbcea2463b33121f64fc5b392..b44f9d680a75ad430e12d857d7b9314bc3089fd9 100644 --- a/src/ipc/shmget.c +++ b/src/ipc/shmget.c @@ -1,9 +1,11 @@ #include +#include #include "syscall.h" #include "ipc.h" int shmget(key_t key, size_t size, int flag) { + if (size > PTRDIFF_MAX) size = SIZE_MAX; #ifdef SYS_shmget return syscall(SYS_shmget, key, size, flag); #else