From 068e222f96b6a6c3b1ef3507a68bb1fd1a905d28 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Fri, 28 Nov 2008 03:05:19 -0800 Subject: [PATCH] --- yaml --- r: 122389 b: refs/heads/master c: ea5693ccc553951ae44cb963b28cce85edc275c9 h: refs/heads/master i: 122387: 37b06064fb914be3cd272d34342387d8956d6546 v: v3 --- [refs] | 2 +- trunk/net/netlink/attr.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0e661f9d9703..2842f580e5ff 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ed77a89c30fa03dcb234a84ddea710b3fb7b62da +refs/heads/master: ea5693ccc553951ae44cb963b28cce85edc275c9 diff --git a/trunk/net/netlink/attr.c b/trunk/net/netlink/attr.c index c83fea7da9a8..56c3ce7fe29a 100644 --- a/trunk/net/netlink/attr.c +++ b/trunk/net/netlink/attr.c @@ -83,6 +83,12 @@ static int validate_nla(struct nlattr *nla, int maxtype, if (attrlen < NLA_ALIGN(pt->len) + NLA_HDRLEN + nla_len(nla)) return -ERANGE; break; + case NLA_NESTED: + /* a nested attributes is allowed to be empty; if its not, + * it must have a size of at least NLA_HDRLEN. + */ + if (attrlen == 0) + break; default: if (pt->len) minlen = pt->len;