[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_security_result_t *OpenAPI_security_result_create(
void OpenAPI_security_result_free(OpenAPI_security_result_t *security_result)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == security_result) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(security_result);
}
cJSON *OpenAPI_security_result_convertToJSON(OpenAPI_security_result_t *security_result)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (security_result == NULL) {
ogs_error("OpenAPI_security_result_convertToJSON() failed [SecurityResult]");
@ -37,14 +39,14 @@ cJSON *OpenAPI_security_result_convertToJSON(OpenAPI_security_result_t *security
}
item = cJSON_CreateObject();
if (security_result->integrity_protection_result) {
if (security_result->integrity_protection_result != OpenAPI_protection_result_NULL) {
if (cJSON_AddStringToObject(item, "integrityProtectionResult", OpenAPI_protection_result_ToString(security_result->integrity_protection_result)) == NULL) {
ogs_error("OpenAPI_security_result_convertToJSON() failed [integrity_protection_result]");
goto end;
}
}
if (security_result->confidentiality_protection_result) {
if (security_result->confidentiality_protection_result != OpenAPI_protection_result_NULL) {
if (cJSON_AddStringToObject(item, "confidentialityProtectionResult", OpenAPI_protection_result_ToString(security_result->confidentiality_protection_result)) == NULL) {
ogs_error("OpenAPI_security_result_convertToJSON() failed [confidentiality_protection_result]");
goto end;
@ -58,9 +60,12 @@ end:
OpenAPI_security_result_t *OpenAPI_security_result_parseFromJSON(cJSON *security_resultJSON)
{
OpenAPI_security_result_t *security_result_local_var = NULL;
cJSON *integrity_protection_result = cJSON_GetObjectItemCaseSensitive(security_resultJSON, "integrityProtectionResult");
OpenAPI_protection_result_e integrity_protection_resultVariable;
OpenAPI_lnode_t *node = NULL;
cJSON *integrity_protection_result = NULL;
OpenAPI_protection_result_e integrity_protection_resultVariable = 0;
cJSON *confidentiality_protection_result = NULL;
OpenAPI_protection_result_e confidentiality_protection_resultVariable = 0;
integrity_protection_result = cJSON_GetObjectItemCaseSensitive(security_resultJSON, "integrityProtectionResult");
if (integrity_protection_result) {
if (!cJSON_IsString(integrity_protection_result)) {
ogs_error("OpenAPI_security_result_parseFromJSON() failed [integrity_protection_result]");
@ -69,9 +74,7 @@ OpenAPI_security_result_t *OpenAPI_security_result_parseFromJSON(cJSON *security
integrity_protection_resultVariable = OpenAPI_protection_result_FromString(integrity_protection_result->valuestring);
}
cJSON *confidentiality_protection_result = cJSON_GetObjectItemCaseSensitive(security_resultJSON, "confidentialityProtectionResult");
OpenAPI_protection_result_e confidentiality_protection_resultVariable;
confidentiality_protection_result = cJSON_GetObjectItemCaseSensitive(security_resultJSON, "confidentialityProtectionResult");
if (confidentiality_protection_result) {
if (!cJSON_IsString(confidentiality_protection_result)) {
ogs_error("OpenAPI_security_result_parseFromJSON() failed [confidentiality_protection_result]");