diff options
author | Ole Troan <ot@cisco.com> | 2017-11-13 08:14:07 +0100 |
---|---|---|
committer | Ole Troan <ot@cisco.com> | 2017-11-13 08:14:37 +0100 |
commit | 192267d490e6f791073236e6e5b303c051cbab48 (patch) | |
tree | 60dae555f518e2628df86c4de14c6c462898201a /src/plugins/nat | |
parent | de5fec943ab12933696db5b0abf287dea335e312 (diff) |
NAT: Buufer overflow for memcpy()
Change-Id: I11d1f9507d429ad8b25e9873272ede231623e622
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/plugins/nat')
-rw-r--r-- | src/plugins/nat/nat64.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/nat/nat64.c b/src/plugins/nat/nat64.c index 936ea9e9988..0054310d18b 100644 --- a/src/plugins/nat/nat64.c +++ b/src/plugins/nat/nat64.c @@ -798,8 +798,7 @@ nat64_compose_ip6 (ip6_address_t * ip6, ip4_address_t * ip4, u32 fib_index) if (prefix) { - memset (ip6, 0, 16); - memcpy (ip6, &p->prefix, p->plen); + clib_memcpy (ip6, &p->prefix, sizeof (ip6_address_t)); switch (p->plen) { case 32: @@ -839,7 +838,7 @@ nat64_compose_ip6 (ip6_address_t * ip6, ip4_address_t * ip4, u32 fib_index) } else { - memcpy (ip6, well_known_prefix, 16); + clib_memcpy (ip6, well_known_prefix, sizeof (ip6_address_t)); ip6->as_u32[3] = ip4->as_u32; } } |