(__cmsg_nxthdr): Correct test for cmsg struct size.
authordrepper <drepper>
Tue, 31 Jul 2001 20:29:48 +0000 (20:29 +0000)
committerdrepper <drepper>
Tue, 31 Jul 2001 20:29:48 +0000 (20:29 +0000)
sysdeps/unix/sysv/linux/bits/socket.h

index 0ec83cc..6ad4a5e 100644 (file)
@@ -268,8 +268,8 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
 
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
                               + CMSG_ALIGN (__cmsg->cmsg_len));
-  if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
-                                        + __mhdr->msg_controllen)
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+                                       + __mhdr->msg_controllen)
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
          > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */