Skip to contentSkip to conversation

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

PATCH New [email protected] 1 participant 1 message Mar 23, 2013

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nfnetlink_acct: return -EINVAL if object name is empty

From: Pablo Neira Ayuso <[email protected]>

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

---
 net/netfilter/nfnetlink_acct.c |    2 ++
 1 file changed, 2 insertions(+)
net/netfilter/nfnetlink_acct.c +2 -0
index 589d686..dc3fd5d 100644
@@ -49,6 +49,8 @@ nfnl_acct_new(struct sock *nfnl, struct sk_buff *skb,
 		return -EINVAL;
 
 	acct_name = nla_data(tb[NFACCT_NAME]);
+	if (strlen(acct_name) == 0)
+		return -EINVAL;
 
 	list_for_each_entry(nfacct, &nfnl_acct_list, head) {
 		if (strncmp(nfacct->name, acct_name, NFACCT_NAME_MAX) != 0)
Signature · 1 line
1.7.10.4