summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/hicn_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin/src/hicn_api.c')
-rw-r--r--hicn-plugin/src/hicn_api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hicn-plugin/src/hicn_api.c b/hicn-plugin/src/hicn_api.c
index df3365999..806de2b4e 100644
--- a/hicn-plugin/src/hicn_api.c
+++ b/hicn-plugin/src/hicn_api.c
@@ -702,7 +702,7 @@ static void vl_api_hicn_api_route_get_t_handler
{
hicn_dpo_vft = hicn_dpo_get_vft(hicn_dpo_id->dpoi_type);
hicn_dpo_ctx = hicn_dpo_vft->hicn_dpo_get_ctx(hicn_dpo_id->dpoi_index);
- for (int i = 0; i < hicn_dpo_ctx->entry_count; i++)
+ for (int i = 0; hicn_dpo_ctx != NULL && i < hicn_dpo_ctx->entry_count; i++)
{
if (dpo_id_is_valid(&hicn_dpo_ctx->next_hops[i]))
{
@@ -739,7 +739,7 @@ send_route_details (vl_api_registration_t * reg,
{
hicn_dpo_vft = hicn_dpo_get_vft (hicn_dpo_id->dpoi_type);
hicn_dpo_ctx = hicn_dpo_vft->hicn_dpo_get_ctx (hicn_dpo_id->dpoi_index);
- for (int i = 0; i < hicn_dpo_ctx->entry_count; i++)
+ for (int i = 0; hicn_dpo_ctx != NULL && i < hicn_dpo_ctx->entry_count; i++)
{
if (dpo_id_is_valid (&hicn_dpo_ctx->next_hops[i]))
{