about summary refs log tree commit diff
path: root/src/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipc')
-rw-r--r--src/ipc/shmget.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ipc/shmget.c b/src/ipc/shmget.c
index 61fb11d9..b44f9d68 100644
--- a/src/ipc/shmget.c
+++ b/src/ipc/shmget.c
@@ -1,9 +1,11 @@
 #include <sys/shm.h>
+#include <stdint.h>
 #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