Skip to content

Commit a85b854

Browse files
committed
wifi: remove zero-length arrays
All of these are really meant to be variable-length, and in the case of s1g_beacon it's actually accessed. Make that one in particular, and a couple of others (that aren't used as arrays now), actually variable. Reported-by: [email protected] Fixes: 1e1f706 ("wifi: cfg80211/mac80211: correctly parse S1G beacon optional elements") Link: https://patch.msgid.link/20250614003037.a3e82e882251.I2e8b58e56ff2a9f8b06c66f036578b7c1d4e4685@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 27605c8 commit a85b854

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

include/linux/ieee80211.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ struct ieee80211_ext {
12781278
u8 sa[ETH_ALEN];
12791279
__le32 timestamp;
12801280
u8 change_seq;
1281-
u8 variable[0];
1281+
u8 variable[];
12821282
} __packed s1g_beacon;
12831283
} u;
12841284
} __packed __aligned(2);
@@ -1536,7 +1536,7 @@ struct ieee80211_mgmt {
15361536
u8 action_code;
15371537
u8 dialog_token;
15381538
__le16 capability;
1539-
u8 variable[0];
1539+
u8 variable[];
15401540
} __packed tdls_discover_resp;
15411541
struct {
15421542
u8 action_code;
@@ -1721,35 +1721,35 @@ struct ieee80211_tdls_data {
17211721
struct {
17221722
u8 dialog_token;
17231723
__le16 capability;
1724-
u8 variable[0];
1724+
u8 variable[];
17251725
} __packed setup_req;
17261726
struct {
17271727
__le16 status_code;
17281728
u8 dialog_token;
17291729
__le16 capability;
1730-
u8 variable[0];
1730+
u8 variable[];
17311731
} __packed setup_resp;
17321732
struct {
17331733
__le16 status_code;
17341734
u8 dialog_token;
1735-
u8 variable[0];
1735+
u8 variable[];
17361736
} __packed setup_cfm;
17371737
struct {
17381738
__le16 reason_code;
1739-
u8 variable[0];
1739+
u8 variable[];
17401740
} __packed teardown;
17411741
struct {
17421742
u8 dialog_token;
1743-
u8 variable[0];
1743+
u8 variable[];
17441744
} __packed discover_req;
17451745
struct {
17461746
u8 target_channel;
17471747
u8 oper_class;
1748-
u8 variable[0];
1748+
u8 variable[];
17491749
} __packed chan_switch_req;
17501750
struct {
17511751
__le16 status_code;
1752-
u8 variable[0];
1752+
u8 variable[];
17531753
} __packed chan_switch_resp;
17541754
} u;
17551755
} __packed;

0 commit comments

Comments
 (0)