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
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,

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