isisd: Prevent direct copy of different size prefix'es

Memory is allocated for a `struct prefix_ipv6` but
it was directly copied into a `struct prefix` via
direct pointer copy, which leads to a read past
end of memory.  Fix by using prefix_copy

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2022-05-06 21:24:56 -04:00
parent ae6ca0e643
commit 14678bfa0d

View File

@ -909,7 +909,7 @@ static int lsp_to_subnet_cb(const struct prefix *prefix, uint32_t metric,
p.u.prefix6 = std->local6;
}
if (!std)
p = *prefix;
prefix_copy(&p, prefix);
else
te_debug(" |- Adjust prefix %pFX with local address to: %pFX",
prefix, &p);