summaryrefslogtreecommitdiff
path: root/pkg/libnl/patch/0003-Avoid-initialization-of-flexible-array-member.patch
blob: 8390197b6d47ccf563ad24733a1888894941bc81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From d1f59de10a2fbce42735b3a1938ecd4d60c8e205 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 11 Aug 2019 21:55:54 +0000
Subject: [PATCH] Avoid initialization of flexible array member

---
 include/netlink-private/cache-api.h | 2 +-
 include/netlink-private/netlink.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/netlink-private/cache-api.h b/include/netlink-private/cache-api.h
index c684e79..82be310 100644
--- a/include/netlink-private/cache-api.h
+++ b/include/netlink-private/cache-api.h
@@ -259,7 +259,7 @@ struct nl_cache_ops
 	struct genl_ops *	co_genl;
 
 	/* Message type definition */
-	struct nl_msgtype	co_msgtypes[];
+	struct nl_msgtype	*co_msgtypes;
 };
 
 /** @} */
diff --git a/include/netlink-private/netlink.h b/include/netlink-private/netlink.h
index fca3133..1148cec 100644
--- a/include/netlink-private/netlink.h
+++ b/include/netlink-private/netlink.h
@@ -200,7 +200,7 @@ static inline const char *nl_cache_name(struct nl_cache *cache)
 }
 
 #define GENL_FAMILY(id, name) \
-	{ \
+	(struct nl_msgtype[]){ \
 		{ id, NL_ACT_UNSPEC, name }, \
 		END_OF_MSGTYPES_LIST, \
 	}
-- 
2.23.0