mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
sys-libs/musl: fix QEMU workaround patch
This is still applied in 1.2.5-r6 but it is masked. Bug: https://bugs.gentoo.org/914256 Closes: https://bugs.gentoo.org/966043 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -8,18 +8,18 @@ https://bugs.gentoo.org/914256
|
||||
#define NLMSG_DATAEND(nlh) ((char*)(nlh)+(nlh)->nlmsg_len)
|
||||
#define NLMSG_NEXT(nlh) (struct nlmsghdr*)((char*)(nlh)+NETLINK_ALIGN((nlh)->nlmsg_len))
|
||||
-#define NLMSG_OK(nlh,end) ((char*)(end)-(char*)(nlh) >= sizeof(struct nlmsghdr))
|
||||
+#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
|
||||
+#define NLMSG_OK(nlh,end) ((char*)(end)-(char*)(nlh) >= sizeof(struct nlmsghdr) && \
|
||||
+ (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
|
||||
+ (nlh)->nlmsg_len <= (len))
|
||||
+ (nlh)->nlmsg_len <= ((char*)(end)-(char*)(nlh)))
|
||||
|
||||
#define RTA_DATA(rta) ((void*)((char*)(rta)+sizeof(struct rtattr)))
|
||||
#define RTA_DATALEN(rta) ((rta)->rta_len-sizeof(struct rtattr))
|
||||
#define RTA_DATAEND(rta) ((char*)(rta)+(rta)->rta_len)
|
||||
#define RTA_NEXT(rta) (struct rtattr*)((char*)(rta)+NETLINK_ALIGN((rta)->rta_len))
|
||||
-#define RTA_OK(rta,end) ((char*)(end)-(char*)(rta) >= sizeof(struct rtattr))
|
||||
+#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
|
||||
+#define RTA_OK(rta,end) ((char*)(end)-(char*)(rta) >= sizeof(struct rtattr) && \
|
||||
+ (rta)->rta_len >= sizeof(struct rtattr) && \
|
||||
+ (rta)->rta_len <= (len))
|
||||
+ (rta)->rta_len <= ((char*)(end)-(char*)(rta)))
|
||||
|
||||
#define NLMSG_RTA(nlh,len) ((void*)((char*)(nlh)+sizeof(struct nlmsghdr)+NETLINK_ALIGN(len)))
|
||||
#define NLMSG_RTAOK(rta,nlh) RTA_OK(rta,NLMSG_DATAEND(nlh))
|
||||
|
||||
Reference in New Issue
Block a user