]> git.puffer.fish Git - mirror/frr.git/commit
isisd: Fix CID 1568134 (Null pointer dereference) 14422/head
authorCarmine Scarpitta <cscarpit@cisco.com>
Fri, 15 Sep 2023 10:36:30 +0000 (12:36 +0200)
committerCarmine Scarpitta <cscarpit@cisco.com>
Fri, 15 Sep 2023 15:42:04 +0000 (17:42 +0200)
commit6ae2a525cf57079adf244510d18bf7647007ce47
tree0188bebb73ef3f0a55cc539b7c852e53c4179d23
parent9de5b3bf58988b4ec5d663aaebda8906126ad29f
isisd: Fix CID 1568134 (Null pointer dereference)

Null check `isis` pointer before dereferencing it.

Fixes this coverity issue:

*** CID 1568134:  Null pointer dereferences  (NULL_RETURNS)
/isisd/isis_zebra.c: 1146 in isis_zebra_process_srv6_locator_chunk()
1140                    "prefix %pFX, block_len %u, node_len %u, func_len %u, arg_len %u",
1141                    chunk->locator_name, &chunk->prefix, chunk->block_bits_length,
1142                    chunk->node_bits_length, chunk->function_bits_length,
1143                    chunk->argument_bits_length);
1144
1145            /* Walk through all areas of the ISIS instance */
>>>     CID 1568134:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "isis", which is known to be "NULL".
1146            for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
1147                    if (strncmp(area->srv6db.config.srv6_locator_name,
1148                                chunk->locator_name,
1149                                sizeof(area->srv6db.config.srv6_locator_name)) != 0)
1150                            continue;
1151

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
isisd/isis_zebra.c