Commit deadcfc3324410726cd6a663fb4fc46be595abe7

Authored by Pablo Neira Ayuso
1 parent 558724a5b2

netfilter: nfnetlink_acct: return -EINVAL if object name is empty

If user-space tries to create accounting object with an empty
name, then return -EINVAL.

Reported-by: Michael Zintakis <michael.zintakis@googlemail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

net/netfilter/nfnetlink_acct.c
... ... @@ -49,6 +49,8 @@
49 49 return -EINVAL;
50 50  
51 51 acct_name = nla_data(tb[NFACCT_NAME]);
  52 + if (strlen(acct_name) == 0)
  53 + return -EINVAL;
52 54  
53 55 list_for_each_entry(nfacct, &nfnl_acct_list, head) {
54 56 if (strncmp(nfacct->name, acct_name, NFACCT_NAME_MAX) != 0)