diff options
| author | F. Aragon <paco@voltanet.io> | 2018-06-29 17:14:23 +0200 | 
|---|---|---|
| committer | F. Aragon <paco@voltanet.io> | 2018-06-29 17:51:44 +0200 | 
| commit | 1230a82d5b3165a200ee8b6742149e06f84aad58 (patch) | |
| tree | d91adbe4cc73db584452ae4cdabfb558e75ef7eb /isisd | |
| parent | 62a9c814e1721a76b251d7c8861c51f196458695 (diff) | |
bgpd isisd: null check (Clang scan)
This correction fixes three bugs detected by Clang scan:
Bug Group: Logic error
Bug Type: Dereference of null pointer
File: bgpd/bgp_evpn.c
Function: bgp_evpn_unconfigure_import_rt_for_vrf
Line: 4246
File: isisd/isis_spf.c
Function: isis_print_paths
Line: 69 (two bugs of same type in one line)
Signed-off-by: F. Aragon <paco@voltanet.io>
Diffstat (limited to 'isisd')
| -rw-r--r-- | isisd/isis_spf.c | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index 2e2933db33..556f2890cf 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1473,8 +1473,9 @@ static void isis_print_paths(struct vty *vty, struct isis_vertex_queue *queue,  		vty_out(vty, "%-20s %-12s %-6u ",  			vid2string(vertex, buff, sizeof(buff)),  			vtype2string(vertex->type), vertex->d_N); -		for (unsigned int i = 0; i < MAX(listcount(vertex->Adj_N), -						 listcount(vertex->parents)); +		for (unsigned int i = 0; +		     i < MAX(vertex->Adj_N ? listcount(vertex->Adj_N) : 0, +			     vertex->parents ? listcount(vertex->parents) : 0);  		     i++) {  			if (anode) {  				adj = listgetdata(anode);  | 
