Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ip6: fix crash when listing 0 nexthops
When no nexthops are configured, the ctx.nh array is NULL. Calling memcpy() on a NULL pointer results in undefined behaviour and sometimes invalid memory access. Apply the same fix than commit 9de2cd2 ("nexthop: fix crash when listing 0 nexthops"). Only call memcpy() if there is at least one nexthop to return. Unify how the address of the nexthop array is passed to memcpy. Fixes: 0fc1cd2 ("modules: add static ipv6 forwarding support") Signed-off-by: Robin Jarry <[email protected]>
- Loading branch information