Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97374
b: refs/heads/master
c: 7bece81
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed May 23, 2008
1 parent 9e8720f commit 160da9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bdefff1f54cb76a19700663f211350de2f65cc91
refs/heads/master: 7bece8155be133cd67c41eed2b31c60a310609de
11 changes: 6 additions & 5 deletions trunk/include/net/netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -772,12 +772,13 @@ static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype,
const struct nla_policy *policy,
int len)
{
if (nla_len(nla) < len)
int nested_len = nla_len(nla) - NLA_ALIGN(len);

if (nested_len < 0)
return -1;
if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr))
return nla_parse_nested(tb, maxtype,
nla_data(nla) + NLA_ALIGN(len),
policy);
if (nested_len >= nla_attr_size(0))
return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len),
nested_len, policy);
memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
return 0;
}
Expand Down

0 comments on commit 160da9e

Please sign in to comment.