[SBI] Crash occurs when ENUM in the MAP (#2103)

This commit is contained in:
Sukchan Lee 2023-03-01 17:50:25 +09:00
parent ce668c556c
commit 969c116e77
1097 changed files with 266728 additions and 42047 deletions

View file

@ -26,17 +26,22 @@ OpenAPI_dnai_information_t *OpenAPI_dnai_information_create(
void OpenAPI_dnai_information_free(OpenAPI_dnai_information_t *dnai_information)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == dnai_information) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(dnai_information->dnai);
if (dnai_information->dnai) {
ogs_free(dnai_information->dnai);
dnai_information->dnai = NULL;
}
ogs_free(dnai_information);
}
cJSON *OpenAPI_dnai_information_convertToJSON(OpenAPI_dnai_information_t *dnai_information)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (dnai_information == NULL) {
ogs_error("OpenAPI_dnai_information_convertToJSON() failed [DnaiInformation]");
@ -44,6 +49,10 @@ cJSON *OpenAPI_dnai_information_convertToJSON(OpenAPI_dnai_information_t *dnai_i
}
item = cJSON_CreateObject();
if (!dnai_information->dnai) {
ogs_error("OpenAPI_dnai_information_convertToJSON() failed [dnai]");
return NULL;
}
if (cJSON_AddStringToObject(item, "dnai", dnai_information->dnai) == NULL) {
ogs_error("OpenAPI_dnai_information_convertToJSON() failed [dnai]");
goto end;
@ -70,19 +79,21 @@ end:
OpenAPI_dnai_information_t *OpenAPI_dnai_information_parseFromJSON(cJSON *dnai_informationJSON)
{
OpenAPI_dnai_information_t *dnai_information_local_var = NULL;
cJSON *dnai = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "dnai");
OpenAPI_lnode_t *node = NULL;
cJSON *dnai = NULL;
cJSON *no_dnai_change_ind = NULL;
cJSON *no_local_psa_change_ind = NULL;
dnai = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "dnai");
if (!dnai) {
ogs_error("OpenAPI_dnai_information_parseFromJSON() failed [dnai]");
goto end;
}
if (!cJSON_IsString(dnai)) {
ogs_error("OpenAPI_dnai_information_parseFromJSON() failed [dnai]");
goto end;
}
cJSON *no_dnai_change_ind = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "noDnaiChangeInd");
no_dnai_change_ind = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "noDnaiChangeInd");
if (no_dnai_change_ind) {
if (!cJSON_IsBool(no_dnai_change_ind)) {
ogs_error("OpenAPI_dnai_information_parseFromJSON() failed [no_dnai_change_ind]");
@ -90,8 +101,7 @@ OpenAPI_dnai_information_t *OpenAPI_dnai_information_parseFromJSON(cJSON *dnai_i
}
}
cJSON *no_local_psa_change_ind = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "noLocalPsaChangeInd");
no_local_psa_change_ind = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "noLocalPsaChangeInd");
if (no_local_psa_change_ind) {
if (!cJSON_IsBool(no_local_psa_change_ind)) {
ogs_error("OpenAPI_dnai_information_parseFromJSON() failed [no_local_psa_change_ind]");