|
@@ -1262,6 +1262,7 @@ do_replace(struct net *net, const void __user *user, unsigned int len)
|
|
|
/* overflow check */
|
|
|
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)
|
|
@@ -1807,6 +1808,7 @@ compat_do_replace(struct net *net, 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)
|
|
@@ -2036,6 +2038,7 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
|
|
|
ret = -EFAULT;
|
|
|
break;
|
|
|
}
|
|
|
+ rev.name[sizeof(rev.name)-1] = 0;
|
|
|
|
|
|
if (cmd == IPT_SO_GET_REVISION_TARGET)
|
|
|
target = 1;
|