History

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.

Kangjie Lu committed 7 years ago

Commit 4589e281 parent 07660ca1 file · +3 −0Browse files

Unified · Split

net/tipc/group.c+3−0
@@ -919,6 +919,9 @@ int tipc_group_fill_sock_diag(struct tipc_group *grp, struct sk_buff *skb) · 918 unmodified lines
919{919{
920 struct nlattr *group = nla_nest_start(skb, TIPC_NLA_SOCK_GROUP);920 struct nlattr *group = nla_nest_start(skb, TIPC_NLA_SOCK_GROUP);
921 921
922 if (!group)
923 return -EMSGSIZE;
924
922 if (nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_ID,925 if (nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_ID,
923 grp->type) ||926 grp->type) ||
924 nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_INSTANCE,927 nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_INSTANCE,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t