about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-09-12 14:44:02 +0200
committerAndreas Schwab <schwab@redhat.com>2011-09-12 15:48:12 +0200
commita7c8e6a1478de9f990b11e5e853318ccbe4330f2 (patch)
tree1b4b0f2d4d7ac67fc70f384e77b9688b03b733d7
parentde82006d43e198fd162807c9adc720c7ebd728a3 (diff)
downloadglibc-a7c8e6a1478de9f990b11e5e853318ccbe4330f2.tar.gz
glibc-a7c8e6a1478de9f990b11e5e853318ccbe4330f2.tar.xz
glibc-a7c8e6a1478de9f990b11e5e853318ccbe4330f2.zip
Fix invalid conversion in __cmsg_nxthdr
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/socket.h4
3 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 77b7be7f37..8ec914fc8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 911b431af3..69e090bd4c 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -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));
@@ -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'.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket.h b/sysdeps/unix/sysv/linux/sparc/bits/socket.h
index c7ef5d896a..6cfbbd7d9b 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/socket.h
@@ -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));
@@ -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'.  */