diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2024-10-22 15:07:26 +0200 |
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2024-10-22 18:24:04 +0200 |
| commit | dd10379b3e4c544874306fbb5efec5afc1cf1f9e (patch) | |
| tree | 078c2d72385353c65995115d0a02f4187bd491a7 | |
| parent | 0078472e19f9b4c496a6b2ef2fa00f0513d9eb1e (diff) | |
bgpd: fix allocating uninitialized bgp_labels
Memory was not zeroed at allocation.
> ==2604268== Conditional jump or move depends on uninitialised value(s)
> ==2604268== at 0x26F026: bgp_labels_unintern (bgp_label.c:116)
> ==2604268== by 0x30000C: adj_free (bgp_updgrp_adv.c:81)
> ==2604268== by 0x3019EE: bgp_adj_out_remove_subgroup (bgp_updgrp_adv.c:728)
> ==2604268== by 0x30537C: subgroup_withdraw_packet (bgp_updgrp_packet.c:1042)
> ==2604268== by 0x2970AF: bgp_generate_updgrp_packets (bgp_packet.c:508)
> ==2604268== by 0x49E06F1: event_call (event.c:2001)
> ==2604268== by 0x495AB8B: frr_run (libfrr.c:1238)
> ==2604268== by 0x200C4B: main (bgp_main.c:555)
Fixes: 3c86f776f0 ("bgpd: add bgp_labels hash")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
| -rw-r--r-- | bgpd/bgp_label.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c index af10111600..5db3621738 100644 --- a/bgpd/bgp_label.c +++ b/bgpd/bgp_label.c @@ -38,7 +38,7 @@ static void *bgp_labels_hash_alloc(void *p) struct bgp_labels *new; uint8_t i; - new = XMALLOC(MTYPE_BGP_LABELS, sizeof(struct bgp_labels)); + new = XCALLOC(MTYPE_BGP_LABELS, sizeof(struct bgp_labels)); new->num_labels = labels->num_labels; for (i = 0; i < labels->num_labels; i++) |
