about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/msgrcv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/msgrcv.c')
-rw-r--r--sysdeps/unix/sysv/linux/msgrcv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/msgrcv.c b/sysdeps/unix/sysv/linux/msgrcv.c
index d0da0d6394..0971143111 100644
--- a/sysdeps/unix/sysv/linux/msgrcv.c
+++ b/sysdeps/unix/sysv/linux/msgrcv.c
@@ -24,12 +24,13 @@
 #include <sysdep.h>
 #include <sys/syscall.h>
 
+#include <bp-checks.h>
 
 /* Kludge to work around Linux' restriction of only up to five
    arguments to a system call.  */
 struct ipc_kludge
   {
-    void *msgp;
+    void *__unbounded msgp;
     long int msgtyp;
   };
 
@@ -46,8 +47,8 @@ msgrcv (msqid, msgp, msgsz, msgtyp, msgflg)
      fives parameters to a system call.  */
   struct ipc_kludge tmp;
 
-  tmp.msgp = msgp;
+  tmp.msgp = CHECK_N (msgp, msgsz);
   tmp.msgtyp = msgtyp;
 
-  return INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg, &tmp);
+  return INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg, __ptrvalue (&tmp));
 }