[Pkg-gnupg-commit] [libassuan] 313/437: 2010-04-16 Marcus Brinkmann <marcus at g10code.de>

Eric Dorland eric at moszumanska.debian.org
Fri May 22 05:33:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libassuan.

commit 00927b8897b8f24e154ab2d61a7c6745ae8bf874
Author: Marcus Brinkmann <mb at g10code.com>
Date:   Fri Apr 16 00:52:49 2010 +0000

    2010-04-16  Marcus Brinkmann  <marcus at g10code.de>
    
    	* assuan-uds.c (uds_reader, uds_sendfd): Don't break strict
    	aliasing rules.
---
 src/ChangeLog    | 5 +++++
 src/assuan-uds.c | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 5f49b61..66d884d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-04-16  Marcus Brinkmann  <marcus at g10code.de>
+
+	* assuan-uds.c (uds_reader, uds_sendfd): Don't break strict
+	aliasing rules.
+
 2010-04-14  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am (install-exec-hook): Rename libgpgcedev-0.dll.
diff --git a/src/assuan-uds.c b/src/assuan-uds.c
index 2e0f821..96cf683 100644
--- a/src/assuan-uds.c
+++ b/src/assuan-uds.c
@@ -116,7 +116,9 @@ uds_reader (assuan_context_t ctx, void *buf, size_t buflen)
 		    "unexpected ancillary data received");
           else
             {
-              int fd = *((int*)CMSG_DATA (cmptr));
+              int fd;
+
+	      memcpy (&fd, CMSG_DATA (cmptr), sizeof (fd));
 
               if (ctx->uds.pendingfdscount >= DIM (ctx->uds.pendingfds))
                 {
@@ -208,7 +210,8 @@ uds_sendfd (assuan_context_t ctx, assuan_fd_t fd)
   cmptr->cmsg_len = CMSG_LEN(sizeof(int));
   cmptr->cmsg_level = SOL_SOCKET;
   cmptr->cmsg_type = SCM_RIGHTS;
-  *((int*)CMSG_DATA (cmptr)) = fd;
+
+  memcpy (CMSG_DATA (cmptr), &fd, sizeof (fd));
 
   len = _assuan_sendmsg (ctx, ctx->outbound.fd, &msg, 0);
   if (len < 0)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libassuan.git



More information about the Pkg-gnupg-commit mailing list