diff options
author | Michael Forney <mforney@mforney.org> | 2019-08-11 04:49:07 +0000 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-08-16 07:42:03 +0200 |
commit | de72910e6b3ec4503f23538682a89c4d444c7a92 (patch) | |
tree | adb4ac751ff7e9d2cbf3a17d9c2191fb0d80e56f /lib/xfrm | |
parent | 1a88619b72c77b5390076ad703bfa3de4fa0348d (diff) | |
download | libnl-de72910e6b3ec4503f23538682a89c4d444c7a92.tar.gz |
all: Avoid pointer arithmetic on `void *`
ISO C requires that the pointer operand to the binary + operator be to
a complete object type[0].
[0] http://port70.net/~nsz/c/c11/n1570.html#6.5.6p2
Diffstat (limited to 'lib/xfrm')
-rw-r--r-- | lib/xfrm/sa.c | 2 | ||||
-rw-r--r-- | lib/xfrm/sp.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/xfrm/sa.c b/lib/xfrm/sa.c index b469b0a2..48265ba4 100644 --- a/lib/xfrm/sa.c +++ b/lib/xfrm/sa.c @@ -682,7 +682,7 @@ int xfrmnl_sa_parse(struct nlmsghdr *n, struct xfrmnl_sa **result) } else if (n->nlmsg_type == XFRM_MSG_DELSA) { - sa_info = (struct xfrm_usersa_info*)(nlmsg_data(n) + sizeof (struct xfrm_usersa_id) + NLA_HDRLEN); + sa_info = (struct xfrm_usersa_info*)((char *)nlmsg_data(n) + sizeof (struct xfrm_usersa_id) + NLA_HDRLEN); } else { diff --git a/lib/xfrm/sp.c b/lib/xfrm/sp.c index fd7585c6..99b6a4ce 100644 --- a/lib/xfrm/sp.c +++ b/lib/xfrm/sp.c @@ -532,7 +532,7 @@ int xfrmnl_sp_parse(struct nlmsghdr *n, struct xfrmnl_sp **result) sp->ce_msgtype = n->nlmsg_type; if (n->nlmsg_type == XFRM_MSG_DELPOLICY) { - sp_info = (struct xfrm_userpolicy_info*)(nlmsg_data(n) + sizeof (struct xfrm_userpolicy_id) + NLA_HDRLEN); + sp_info = (struct xfrm_userpolicy_info*)((char *)nlmsg_data(n) + sizeof (struct xfrm_userpolicy_id) + NLA_HDRLEN); } else { |