nla_nest_start could fail and requires a check. The fix returns -EMSGSIZE if it fails.
Unified · Split
| @@ -919,6 +919,9 @@ int tipc_group_fill_sock_diag(struct tipc_group *grp, struct sk_buff *skb) · 918 unmodified lines | ||
| 919 | 919 | { |
| 920 | 920 | struct nlattr *group = nla_nest_start(skb, TIPC_NLA_SOCK_GROUP); |
| 921 | 921 | |
| 922 | + if (!group) | |
| 923 | + return -EMSGSIZE; | |
| 924 | + | |
| 922 | 925 | if (nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_ID, |
| 923 | 926 | grp->type) || |
| 924 | 927 | nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_INSTANCE, |