[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

@ -20,16 +20,18 @@ OpenAPI_up_security_t *OpenAPI_up_security_create(
void OpenAPI_up_security_free(OpenAPI_up_security_t *up_security)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == up_security) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(up_security);
}
cJSON *OpenAPI_up_security_convertToJSON(OpenAPI_up_security_t *up_security)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (up_security == NULL) {
ogs_error("OpenAPI_up_security_convertToJSON() failed [UpSecurity]");
@ -37,11 +39,19 @@ cJSON *OpenAPI_up_security_convertToJSON(OpenAPI_up_security_t *up_security)
}
item = cJSON_CreateObject();
if (up_security->up_integr == OpenAPI_up_integrity_NULL) {
ogs_error("OpenAPI_up_security_convertToJSON() failed [up_integr]");
return NULL;
}
if (cJSON_AddStringToObject(item, "upIntegr", OpenAPI_up_integrity_ToString(up_security->up_integr)) == NULL) {
ogs_error("OpenAPI_up_security_convertToJSON() failed [up_integr]");
goto end;
}
if (up_security->up_confid == OpenAPI_up_confidentiality_NULL) {
ogs_error("OpenAPI_up_security_convertToJSON() failed [up_confid]");
return NULL;
}
if (cJSON_AddStringToObject(item, "upConfid", OpenAPI_up_confidentiality_ToString(up_security->up_confid)) == NULL) {
ogs_error("OpenAPI_up_security_convertToJSON() failed [up_confid]");
goto end;
@ -54,26 +64,27 @@ end:
OpenAPI_up_security_t *OpenAPI_up_security_parseFromJSON(cJSON *up_securityJSON)
{
OpenAPI_up_security_t *up_security_local_var = NULL;
cJSON *up_integr = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upIntegr");
OpenAPI_lnode_t *node = NULL;
cJSON *up_integr = NULL;
OpenAPI_up_integrity_e up_integrVariable = 0;
cJSON *up_confid = NULL;
OpenAPI_up_confidentiality_e up_confidVariable = 0;
up_integr = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upIntegr");
if (!up_integr) {
ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_integr]");
goto end;
}
OpenAPI_up_integrity_e up_integrVariable;
if (!cJSON_IsString(up_integr)) {
ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_integr]");
goto end;
}
up_integrVariable = OpenAPI_up_integrity_FromString(up_integr->valuestring);
cJSON *up_confid = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upConfid");
up_confid = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upConfid");
if (!up_confid) {
ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_confid]");
goto end;
}
OpenAPI_up_confidentiality_e up_confidVariable;
if (!cJSON_IsString(up_confid)) {
ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_confid]");
goto end;