mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 22:26:14 +00:00
ospfd: Prevent crash by accessing memory not owned.
When allocating memory for the `struct ospf_metric` we were using `uint32_t` instead of the actual size of this structure. When we wrote to it we would be writing into other people's memory. Found-by: Amol Lad Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
f286bcf5fc
commit
cf0f13de29
@ -416,7 +416,7 @@ static void *route_set_metric_compile(const char *arg)
|
||||
{
|
||||
struct ospf_metric *metric;
|
||||
|
||||
metric = XCALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(uint32_t));
|
||||
metric = XCALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(*metric));
|
||||
metric->used = false;
|
||||
|
||||
if (all_digit(arg))
|
||||
|
Loading…
Reference in New Issue
Block a user