mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 15:42:32 +00:00
openvswitch: Use proper buffer size in nla_memcpy
For the input parameter count, it's better to use the size of destination buffer size, as nla_memcpy would take into account the length of the source netlink attribute when a data is copied from an attribute. Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d7be81a591
commit
ac71b46efd
1 changed files with 2 additions and 1 deletions
|
@ -968,7 +968,8 @@ static int parse_nat(const struct nlattr *attr,
|
|||
break;
|
||||
|
||||
case OVS_NAT_ATTR_IP_MIN:
|
||||
nla_memcpy(&info->range.min_addr, a, nla_len(a));
|
||||
nla_memcpy(&info->range.min_addr, a,
|
||||
sizeof(info->range.min_addr));
|
||||
info->range.flags |= NF_NAT_RANGE_MAP_IPS;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue