Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ovpn: use correct array size to parse nested attributes in ovpn_nl_key_swap_doit

In ovpn_nl_key_swap_doit, the attributes array used to parse the
OVPN_A_KEYCONF uses OVPN_A_PEER_MAX instead of
OVPN_A_KEYCONF_MAX. Note that this does not cause any bug, since
currently OVPN_A_KEYCONF_MAX < OVPN_A_PEER_MAX.

The wrong constant was introduced by commit 203e2bf55990
("ovpn: implement key add/get/del/swap via netlink")

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>

authored by

Sabrina Dubroca and committed by
Antonio Quartulli
7e7ca01d a8e136b4

+1 -1
+1 -1
drivers/net/ovpn/netlink.c
··· 1061 1061 1062 1062 int ovpn_nl_key_swap_doit(struct sk_buff *skb, struct genl_info *info) 1063 1063 { 1064 + struct nlattr *attrs[OVPN_A_KEYCONF_MAX + 1]; 1064 1065 struct ovpn_priv *ovpn = info->user_ptr[0]; 1065 - struct nlattr *attrs[OVPN_A_PEER_MAX + 1]; 1066 1066 struct ovpn_peer *peer; 1067 1067 u32 peer_id; 1068 1068 int ret;