@@ -816,6 +816,7 @@ static int do_replace(void __user *user, unsigned int len)
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM;
+ tmp.name[sizeof(tmp.name)-1] = 0;
newinfo = xt_alloc_table_info(tmp.size);
if (!newinfo)
@@ -930,6 +931,7 @@ static int do_add_counters(void __user *user, unsigned int len)
paddc = vmalloc(len);
if (!paddc)
return -ENOMEM;
+ tmp.name[sizeof(tmp.name)-1] = 0;
if (copy_from_user(paddc, user, len) != 0) {
ret = -EFAULT;
@@ -1070,6 +1072,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len
ret = -EFAULT;
break;
}
+ rev.name[sizeof(rev.name)-1] = 0;
try_then_request_module(xt_find_revision(NF_ARP, rev.name,
rev.revision, 1, &ret),