mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
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>
This commit is contained in:
parent
07660ca679
commit
4589e28db4
1 changed files with 3 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue