Skip to content

Commit

Permalink
Fix invalid conversion in __cmsg_nxthdr
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schwab committed Sep 12, 2011
1 parent de82006 commit a7c8e6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
2011-09-12 Andreas Schwab <schwab@redhat.com>

* sysdeps/unix/sysv/linux/bits/socket.h (__cmsg_nxthdr): Cast to
`struct cmsghdr *' instead of `void *'.
* sysdeps/unix/sysv/linux/sparc/bits/socket.h (__cmsg_nxthdr):
Likewise.

* elf/rtld.c: Remove use of USE___THREAD.

2011-09-11 Andreas Schwab <schwab@linux-m68k.org>
Expand Down
4 changes: 2 additions & 2 deletions sysdeps/unix/sysv/linux/bits/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
{
if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
/* The kernel header does this so there may be a reason. */
return (void *) 0;
return (struct cmsghdr *) 0;

__cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ CMSG_ALIGN (__cmsg->cmsg_len));
Expand All @@ -327,7 +327,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
|| ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
> ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
/* No more entries. */
return (void *) 0;
return (struct cmsghdr *) 0;
return __cmsg;
}
#endif /* Use `extern inline'. */
Expand Down
4 changes: 2 additions & 2 deletions sysdeps/unix/sysv/linux/sparc/bits/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
{
if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
/* The kernel header does this so there may be a reason. */
return (void *) 0;
return (struct cmsghdr *) 0;

__cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ CMSG_ALIGN (__cmsg->cmsg_len));
Expand All @@ -327,7 +327,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
|| ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
> ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
/* No more entries. */
return (void *) 0;
return (struct cmsghdr *) 0;
return __cmsg;
}
#endif /* Use `extern inline'. */
Expand Down

0 comments on commit a7c8e6a

Please sign in to comment.