[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

@ -110,6 +110,12 @@ OpenAPI_complex_query_t *OpenAPI_complex_query_parseFromJSON(cJSON *complex_quer
}
OpenAPI_cnf_unit_t *cnf_unitsItem = OpenAPI_cnf_unit_parseFromJSON(cnf_units_local_nonprimitive);
if (!cnf_unitsItem) {
ogs_error("No cnf_unitsItem");
OpenAPI_list_free(cnf_unitsList);
goto end;
}
OpenAPI_list_add(cnf_unitsList, cnf_unitsItem);
}
@ -135,6 +141,12 @@ OpenAPI_complex_query_t *OpenAPI_complex_query_parseFromJSON(cJSON *complex_quer
}
OpenAPI_dnf_unit_t *dnf_unitsItem = OpenAPI_dnf_unit_parseFromJSON(dnf_units_local_nonprimitive);
if (!dnf_unitsItem) {
ogs_error("No dnf_unitsItem");
OpenAPI_list_free(dnf_unitsList);
goto end;
}
OpenAPI_list_add(dnf_unitsList, dnf_unitsItem);
}