aboutsummaryrefslogtreecommitdiffstats
path: root/src/assuan-uds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/assuan-uds.c')
-rw-r--r--src/assuan-uds.c7
1 files changed, 5 insertions, 2 deletions
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)