diff options
| author | sarita patra <saritap@vmware.com> | 2022-04-04 03:55:23 -0700 |
|---|---|---|
| committer | sarita patra <saritap@vmware.com> | 2022-04-04 05:27:59 -0700 |
| commit | 75a5ac751a9528682c5fe8518e0924b5d5f01424 (patch) | |
| tree | 165b7f6c1e0e272efb011761714c517000d86095 /pimd/pim_zlookup.c | |
| parent | e2067d591bb981225eaceb5ba7bf8d679e242689 (diff) | |
pimd: fix pim_instance NULL deference in zclient_lookup_read_pipe
Fixing the below coverity issue.
>>> CID 1515546: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a pointer that might be "NULL" "pim" when calling "zclient_lookup_nexthop_once".
391 zclient_lookup_nexthop_once(pim, nexthop_tab, 10, l);
Signed-off-by: sarita patra <saritap@vmware.com>
Diffstat (limited to 'pimd/pim_zlookup.c')
| -rw-r--r-- | pimd/pim_zlookup.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index c487f995e7..5d99f131a8 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -388,6 +388,12 @@ void zclient_lookup_read_pipe(struct thread *thread) struct pim_zlookup_nexthop nexthop_tab[10]; struct in_addr l = {.s_addr = INADDR_ANY}; + if (!pim) { + if (PIM_DEBUG_PIM_NHT_DETAIL) + zlog_debug("%s: Unable to find pim instance", __func__); + return; + } + zclient_lookup_nexthop_once(pim, nexthop_tab, 10, l); thread_add_timer(router->master, zclient_lookup_read_pipe, zlookup, 60, &zlookup_read); |
