summaryrefslogtreecommitdiff
path: root/pkg/acpid2/patch/0001-Avoid-void-pointer-arithmetic.patch
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-08-16 17:44:20 -0700
committerMichael Forney <mforney@mforney.org>2020-08-16 18:23:41 -0700
commit8f040a0f002da3c0efd753c40012c30da8555df3 (patch)
treec296b2886354a3b5dc158f037991d51b7186d3e7 /pkg/acpid2/patch/0001-Avoid-void-pointer-arithmetic.patch
parent3d514acfe7cf80ea5dfc189055bb2e7fdf6a2d43 (diff)
Add acpid2 2.0.32
Diffstat (limited to 'pkg/acpid2/patch/0001-Avoid-void-pointer-arithmetic.patch')
-rw-r--r--pkg/acpid2/patch/0001-Avoid-void-pointer-arithmetic.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkg/acpid2/patch/0001-Avoid-void-pointer-arithmetic.patch b/pkg/acpid2/patch/0001-Avoid-void-pointer-arithmetic.patch
new file mode 100644
index 00000000..9f506cdf
--- /dev/null
+++ b/pkg/acpid2/patch/0001-Avoid-void-pointer-arithmetic.patch
@@ -0,0 +1,54 @@
+From a6a138ee8c131b4ce056a5db516496c91610cf2f Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sun, 16 Aug 2020 18:00:54 -0700
+Subject: [PATCH] Avoid void pointer arithmetic
+
+ISO C requires the pointer to be to a complete object type.
+---
+ acpi_ids.c | 2 +-
+ libnetlink.c | 2 +-
+ libnetlink.h | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/acpi_ids.c b/acpi_ids.c
+index ba218d7..08271cb 100644
+--- a/acpi_ids.c
++++ b/acpi_ids.c
+@@ -126,7 +126,7 @@ genl_get_mcast_group_id(struct nlmsghdr *n)
+ }
+
+ /* set attrs to point to the attribute */
+- attrs = (struct rtattr *)(NLMSG_DATA(n) + GENL_HDRLEN);
++ attrs = (struct rtattr *)((char *)NLMSG_DATA(n) + GENL_HDRLEN);
+ /* Read the table from the message into "tb". This actually just */
+ /* places pointers into the message into tb[]. */
+ parse_rtattr(tb, CTRL_ATTR_MAX, attrs, len);
+diff --git a/libnetlink.c b/libnetlink.c
+index 346162a..b1760ba 100644
+--- a/libnetlink.c
++++ b/libnetlink.c
+@@ -516,7 +516,7 @@ int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
+ }
+
+ memcpy(NLMSG_TAIL(n), data, len);
+- memset((void *) NLMSG_TAIL(n) + len, 0, NLMSG_ALIGN(len) - len);
++ memset((char *) NLMSG_TAIL(n) + len, 0, NLMSG_ALIGN(len) - len);
+ n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len);
+ return 0;
+ }
+diff --git a/libnetlink.h b/libnetlink.h
+index 8f9cb5e..7b2f8bc 100644
+--- a/libnetlink.h
++++ b/libnetlink.h
+@@ -53,7 +53,7 @@ extern int rtnl_from_file(FILE *, rtnl_filter_t handler,
+ void *jarg);
+
+ #define NLMSG_TAIL(nmsg) \
+- ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
++ ((struct rtattr *) (((char *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
+
+ #ifndef IFA_RTA
+ #define IFA_RTA(r) \
+--
+2.28.0
+