Skip to content

Commit 4589e28

Browse files
kengiterdavem330
authored andcommitted
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: Kangjie Lu <kjlu@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 07660ca commit 4589e28

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎net/tipc/group.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,9 @@ int tipc_group_fill_sock_diag(struct tipc_group *grp, struct sk_buff *skb)
919919
{
920920
struct nlattr *group = nla_nest_start(skb, TIPC_NLA_SOCK_GROUP);
921921

922+
if (!group)
923+
return -EMSGSIZE;
924+
922925
if (nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_ID,
923926
grp->type) ||
924927
nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_INSTANCE,

0 commit comments

Comments
 (0)