diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2019-07-10 15:39:53 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2019-07-10 15:39:53 +0200 |
commit | 2b9c51d633c0592a33c976b0fb93cc48fc3d4f5b (patch) | |
tree | 7b0186ce2fabe43553dc36ccf7503d179d0b6b34 | |
parent | 2d7cc61101e7b6a3b5d942a7e79961a79303c812 (diff) |
proto: Fix aliasing error when setting the FD in the CMSG data
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r-- | src/proto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/proto.c b/src/proto.c index 04e533a..ee59ad1 100644 --- a/src/proto.c +++ b/src/proto.c @@ -131,7 +131,7 @@ osmo_e1dp_send(struct osmo_fd *ofd, struct msgb *msgb, int fd) cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(sizeof(int)); - *(int*) CMSG_DATA(cmsg) = fd; + memmove(CMSG_DATA(cmsg), &fd, sizeof(int)); } rc = sendmsg(ofd->fd, &msg, 0); |