diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-10-09 12:54:08 +0200 |
---|---|---|
committer | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-10-09 12:54:08 +0200 |
commit | 1e0e7377bb2854b49b5e52ec5a39b818640f644b (patch) | |
tree | cef1a95a241de9ddf7c326179d51ce671019b2d1 /lib/src/name.c | |
parent | d61668ec9ee63307eef161e197e09981f327b984 (diff) |
[HICN-311] Incorrect copying of ip_prefix_t data & uninitialized bytes causes invalid writes
Change-Id: Ia171dac11f65dab295b3523222145215f21a6f4f
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'lib/src/name.c')
-rw-r--r-- | lib/src/name.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/src/name.c b/lib/src/name.c index 1f1051522..a19971d49 100644 --- a/lib/src/name.c +++ b/lib/src/name.c @@ -95,7 +95,8 @@ hicn_name_create_from_prefix (const ip_prefix_t * prefix, u32 id, return HICN_LIB_ERROR_NOT_IMPLEMENTED; } - memcpy (name->buffer, prefix->address.buffer, ip_prefix_len (prefix)); + memcpy (name->buffer, prefix->address.buffer, + ip_address_len(&prefix->address, prefix->family)); *(u32 *) (name->buffer + name->len) = id; return HICN_LIB_ERROR_NONE; |