[svn] assuan - r370 - trunk/src
svn author marcus
cvs at cvs.gnupg.org
Fri Apr 16 02:52:49 CEST 2010
Author: marcus
Date: 2010-04-16 02:52:49 +0200 (Fri, 16 Apr 2010)
New Revision: 370
Modified:
trunk/src/ChangeLog
trunk/src/assuan-uds.c
Log:
2010-04-16 Marcus Brinkmann <marcus at g10code.de>
* assuan-uds.c (uds_reader, uds_sendfd): Don't break strict
aliasing rules.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2010-04-14 14:33:25 UTC (rev 369)
+++ trunk/src/ChangeLog 2010-04-16 00:52:49 UTC (rev 370)
@@ -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.
Modified: trunk/src/assuan-uds.c
===================================================================
--- trunk/src/assuan-uds.c 2010-04-14 14:33:25 UTC (rev 369)
+++ trunk/src/assuan-uds.c 2010-04-16 00:52:49 UTC (rev 370)
@@ -116,8 +116,10 @@
"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))
{
TRACE1 (ctx, ASSUAN_LOG_SYSIO, "uds_reader", ctx,
@@ -208,8 +210,9 @@
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)
{
More information about the Gnupg-commits
mailing list