Skip to content
Commit 1140f8bc authored by Lin Ma's avatar Lin Ma Committed by Greg Kroah-Hartman
Browse files

net: tipc: resize nlattr array to correct size

[ Upstream commit 44194cb1 ]

According to nla_parse_nested_deprecated(), the tb[] is supposed to the
destination array with maxtype+1 elements. In current
tipc_nl_media_get() and __tipc_nl_media_set(), a larger array is used
which is unnecessary. This patch resize them to a proper size.

Fixes: 1e55417d ("tipc: add media set to new netlink api")
Fixes: 46f15c67

 ("tipc: add media get/dump to new netlink api")
Signed-off-by: default avatarLin Ma <linma@zju.edu.cn>
Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
Reviewed-by: default avatarTung Nguyen <tung.q.nguyen@dektech.com.au>
Link: https://lore.kernel.org/r/20230614120604.1196377-1-linma@zju.edu.cn


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b83f86ba
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment