[SBI] fix crash when no mandatory item (#1350)

NRF crashed if NFService does not have a versions.
Versions are mandatory, we've modified the SBI interface for the safety.
This commit is contained in:
Sukchan Lee 2022-02-05 20:20:45 +09:00
parent acfcbda8fa
commit 900e888dc1
219 changed files with 2474 additions and 0 deletions

View file

@ -163,6 +163,12 @@ OpenAPI_network_area_info_t *OpenAPI_network_area_info_parseFromJSON(cJSON *netw
}
OpenAPI_ecgi_t *ecgisItem = OpenAPI_ecgi_parseFromJSON(ecgis_local_nonprimitive);
if (!ecgisItem) {
ogs_error("No ecgisItem");
OpenAPI_list_free(ecgisList);
goto end;
}
OpenAPI_list_add(ecgisList, ecgisItem);
}
}
@ -186,6 +192,12 @@ OpenAPI_network_area_info_t *OpenAPI_network_area_info_parseFromJSON(cJSON *netw
}
OpenAPI_ncgi_t *ncgisItem = OpenAPI_ncgi_parseFromJSON(ncgis_local_nonprimitive);
if (!ncgisItem) {
ogs_error("No ncgisItem");
OpenAPI_list_free(ncgisList);
goto end;
}
OpenAPI_list_add(ncgisList, ncgisItem);
}
}
@ -209,6 +221,12 @@ OpenAPI_network_area_info_t *OpenAPI_network_area_info_parseFromJSON(cJSON *netw
}
OpenAPI_global_ran_node_id_t *g_ran_node_idsItem = OpenAPI_global_ran_node_id_parseFromJSON(g_ran_node_ids_local_nonprimitive);
if (!g_ran_node_idsItem) {
ogs_error("No g_ran_node_idsItem");
OpenAPI_list_free(g_ran_node_idsList);
goto end;
}
OpenAPI_list_add(g_ran_node_idsList, g_ran_node_idsItem);
}
}
@ -232,6 +250,12 @@ OpenAPI_network_area_info_t *OpenAPI_network_area_info_parseFromJSON(cJSON *netw
}
OpenAPI_tai_t *taisItem = OpenAPI_tai_parseFromJSON(tais_local_nonprimitive);
if (!taisItem) {
ogs_error("No taisItem");
OpenAPI_list_free(taisList);
goto end;
}
OpenAPI_list_add(taisList, taisItem);
}
}