]> git.puffer.fish Git - mirror/frr.git/commit
isisd: Fix CID 1568133 (Null pointer dereference)
authorCarmine Scarpitta <cscarpit@cisco.com>
Fri, 15 Sep 2023 10:30:39 +0000 (12:30 +0200)
committerCarmine Scarpitta <cscarpit@cisco.com>
Fri, 15 Sep 2023 15:42:04 +0000 (17:42 +0200)
commit9de5b3bf58988b4ec5d663aaebda8906126ad29f
tree84ab00aeafffc7b15517ab186c85971d1f75dc94
parentf3b4e6664fb8476342dbc90bb6016dac20c5cace
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>
isisd/isis_zebra.c