mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 13:27:53 +00:00
isisd: Fix CID 1568133 (Null pointer dereference)
Null checking the `sra` pointer after dereferencing it causes a coverity issue. Let's perform the null check before dereferencing the pointer. Fixes this coverity issue: *** CID 1568133: Null pointer dereferences (REVERSE_INULL) /isisd/isis_zebra.c: 1077 in isis_zebra_srv6_adj_sid_uninstall() 1071 enum seg6local_action_t action = ZEBRA_SEG6_LOCAL_ACTION_UNSPEC; 1072 struct interface *ifp; 1073 uint16_t prefixlen = IPV6_MAX_BITLEN; 1074 struct isis_circuit *circuit = sra->adj->circuit; 1075 struct isis_area *area = circuit->area; 1076 >>> CID 1568133: Null pointer dereferences (REVERSE_INULL) >>> Null-checking "sra" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 1077 if (!sra) 1078 return; 1079 1080 switch (sra->behavior) { 1081 case SRV6_ENDPOINT_BEHAVIOR_END_X: 1082 prefixlen = IPV6_MAX_BITLEN; Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit is contained in:
parent
f3b4e6664f
commit
9de5b3bf58
@ -1074,12 +1074,15 @@ void isis_zebra_srv6_adj_sid_uninstall(struct srv6_adjacency *sra)
|
|||||||
enum seg6local_action_t action = ZEBRA_SEG6_LOCAL_ACTION_UNSPEC;
|
enum seg6local_action_t action = ZEBRA_SEG6_LOCAL_ACTION_UNSPEC;
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
uint16_t prefixlen = IPV6_MAX_BITLEN;
|
uint16_t prefixlen = IPV6_MAX_BITLEN;
|
||||||
struct isis_circuit *circuit = sra->adj->circuit;
|
struct isis_circuit *circuit;
|
||||||
struct isis_area *area = circuit->area;
|
struct isis_area *area;
|
||||||
|
|
||||||
if (!sra)
|
if (!sra)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
circuit = sra->adj->circuit;
|
||||||
|
area = circuit->area;
|
||||||
|
|
||||||
switch (sra->behavior) {
|
switch (sra->behavior) {
|
||||||
case SRV6_ENDPOINT_BEHAVIOR_END_X:
|
case SRV6_ENDPOINT_BEHAVIOR_END_X:
|
||||||
prefixlen = IPV6_MAX_BITLEN;
|
prefixlen = IPV6_MAX_BITLEN;
|
||||||
|
Loading…
Reference in New Issue
Block a user