diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2021-05-24 13:30:26 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2021-05-24 13:30:26 +0200 |
commit | 0f8443653dc210b7a982971105eaf380105043e3 (patch) | |
tree | cea111376ae030bf2e6bbe4b51b3bb9dc81b543e /ospf6d/ospf6_asbr.c | |
parent | Merge pull request #8716 from idryzhov/fix-commands (diff) | |
download | frr-0f8443653dc210b7a982971105eaf380105043e3.tar.xz frr-0f8443653dc210b7a982971105eaf380105043e3.zip |
ospf6d: fix address sanitizer crash
Don't `memcpy` a `struct prefix` the memory size varies depending on the
original intended type. In this case the original type was (casted away)
`struct prefix_ipv6` and we tried to copy `struct prefix` which is
bigger.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to '')
-rw-r--r-- | ospf6d/ospf6_asbr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 96dcdba68..245e5dcd3 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -1282,7 +1282,7 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex, /* create new entry */ route = ospf6_route_create(); route->type = OSPF6_DEST_TYPE_NETWORK; - memcpy(&route->prefix, prefix, sizeof(struct prefix)); + prefix_copy(&route->prefix, prefix); info = (struct ospf6_external_info *)XCALLOC( MTYPE_OSPF6_EXTERNAL_INFO, sizeof(struct ospf6_external_info)); |