diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2021-01-30 14:15:54 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2021-01-30 14:15:54 -0500 | 
| commit | f735c2e8255f26dbeaabb587e3e0a4cb63099427 (patch) | |
| tree | b49069b9dc1fd7fe9c5f77f89a5a6a2f78d34e31 /isisd/isis_ldp_sync.c | |
| parent | dd53fd0832e1e30b7d8289678d46e56f6ab2e7a3 (diff) | |
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 <sharpd@nvidia.com>
Diffstat (limited to 'isisd/isis_ldp_sync.c')
| -rw-r--r-- | isisd/isis_ldp_sync.c | 1 | 
1 files changed, 1 insertions, 0 deletions
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;  | 
