From: Donald Sharp Date: Sat, 30 Jan 2021 19:15:54 +0000 (-0500) Subject: isisd: Prevent sending of uninited data to zebra X-Git-Tag: base_8.0~440^2~3 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=f735c2e8255f26dbeaabb587e3e0a4cb63099427;p=mirror%2Ffrr.git isisd: Prevent sending of uninited data to zebra Valgrind reports: 2172861-==2172861== 2172861-==2172861== Syscall param write(buf) points to uninitialised byte(s) 2172861:==2172861== at 0x49B4FB3: write (write.c:26) 2172861-==2172861== by 0x48A4EA0: buffer_write (buffer.c:475) 2172861-==2172861== by 0x4915AD9: zclient_send_message (zclient.c:298) 2172861-==2172861== by 0x12AE08: isis_ldp_sync_state_req_msg (isis_ldp_sync.c:152) 2172861-==2172861== by 0x12B74B: isis_ldp_sync_adj_state_change (isis_ldp_sync.c:305) 2172861-==2172861== by 0x16DE04: hook_call_isis_adj_state_change_hook.isra.0 (isis_adjacency.c:141) 2172861-==2172861== by 0x16EE27: isis_adj_state_change (isis_adjacency.c:371) 2172861-==2172861== by 0x16F1F3: isis_adj_process_threeway (isis_adjacency.c:242) 2172861-==2172861== by 0x13BCCA: process_p2p_hello (isis_pdu.c:283) 2172861-==2172861== by 0x13BCCA: process_hello (isis_pdu.c:781) 2172861-==2172861== by 0x13BCCA: isis_handle_pdu (isis_pdu.c:1700) Sending of request includes uninited memory at the end of the interface name string. Fix Signed-off-by: Donald Sharp --- diff --git a/isisd/isis_ldp_sync.c b/isisd/isis_ldp_sync.c index 00bef5c782..585f769806 100644 --- a/isisd/isis_ldp_sync.c +++ b/isisd/isis_ldp_sync.c @@ -145,6 +145,7 @@ void isis_ldp_sync_state_req_msg(struct isis_circuit *circuit) ils_debug("ldp_sync: send state request to LDP for %s", ifp->name); + memset(&request, 0, sizeof(request)); strlcpy(request.name, ifp->name, sizeof(ifp->name)); request.proto = LDP_IGP_SYNC_IF_STATE_REQUEST; request.ifindex = ifp->ifindex;