|
@@ -892,7 +892,7 @@ void *xt_copy_counters_from_user(const void __user *user, unsigned int len,
|
|
if (copy_from_user(&compat_tmp, user, sizeof(compat_tmp)) != 0)
|
|
if (copy_from_user(&compat_tmp, user, sizeof(compat_tmp)) != 0)
|
|
return ERR_PTR(-EFAULT);
|
|
return ERR_PTR(-EFAULT);
|
|
|
|
|
|
- strlcpy(info->name, compat_tmp.name, sizeof(info->name));
|
|
|
|
|
|
+ memcpy(info->name, compat_tmp.name, sizeof(info->name) - 1);
|
|
info->num_counters = compat_tmp.num_counters;
|
|
info->num_counters = compat_tmp.num_counters;
|
|
user += sizeof(compat_tmp);
|
|
user += sizeof(compat_tmp);
|
|
} else
|
|
} else
|
|
@@ -905,9 +905,9 @@ void *xt_copy_counters_from_user(const void __user *user, unsigned int len,
|
|
if (copy_from_user(info, user, sizeof(*info)) != 0)
|
|
if (copy_from_user(info, user, sizeof(*info)) != 0)
|
|
return ERR_PTR(-EFAULT);
|
|
return ERR_PTR(-EFAULT);
|
|
|
|
|
|
- info->name[sizeof(info->name) - 1] = '\0';
|
|
|
|
user += sizeof(*info);
|
|
user += sizeof(*info);
|
|
}
|
|
}
|
|
|
|
+ info->name[sizeof(info->name) - 1] = '\0';
|
|
|
|
|
|
size = sizeof(struct xt_counters);
|
|
size = sizeof(struct xt_counters);
|
|
size *= info->num_counters;
|
|
size *= info->num_counters;
|