Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4589e28d authored by Kangjie Lu's avatar Kangjie Lu Committed by David S. Miller
Browse files

net: tipc: fix a missing check of nla_nest_start



nla_nest_start could fail and requires a check. The fix returns
-EMSGSIZE if it fails.

Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07660ca6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -919,6 +919,9 @@ int tipc_group_fill_sock_diag(struct tipc_group *grp, struct sk_buff *skb)
{
	struct nlattr *group = nla_nest_start(skb, TIPC_NLA_SOCK_GROUP);

	if (!group)
		return -EMSGSIZE;

	if (nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_ID,
			grp->type) ||
	    nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_INSTANCE,