mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +00:00
[SBI] Crash occurs when ENUM in the MAP (#2103)
This commit is contained in:
parent
ce668c556c
commit
969c116e77
1097 changed files with 266728 additions and 42047 deletions
|
|
@ -22,18 +22,26 @@ OpenAPI_n4_information_t *OpenAPI_n4_information_create(
|
|||
|
||||
void OpenAPI_n4_information_free(OpenAPI_n4_information_t *n4_information)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == n4_information) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_ref_to_binary_data_free(n4_information->n4_message_payload);
|
||||
OpenAPI_dnai_information_free(n4_information->n4_dnai_info);
|
||||
if (n4_information->n4_message_payload) {
|
||||
OpenAPI_ref_to_binary_data_free(n4_information->n4_message_payload);
|
||||
n4_information->n4_message_payload = NULL;
|
||||
}
|
||||
if (n4_information->n4_dnai_info) {
|
||||
OpenAPI_dnai_information_free(n4_information->n4_dnai_info);
|
||||
n4_information->n4_dnai_info = NULL;
|
||||
}
|
||||
ogs_free(n4_information);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_n4_information_convertToJSON(OpenAPI_n4_information_t *n4_information)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (n4_information == NULL) {
|
||||
ogs_error("OpenAPI_n4_information_convertToJSON() failed [N4Information]");
|
||||
|
|
@ -41,11 +49,19 @@ cJSON *OpenAPI_n4_information_convertToJSON(OpenAPI_n4_information_t *n4_informa
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (n4_information->n4_message_type == OpenAPI_n4_message_type_NULL) {
|
||||
ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_type]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "n4MessageType", OpenAPI_n4_message_type_ToString(n4_information->n4_message_type)) == NULL) {
|
||||
ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_type]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!n4_information->n4_message_payload) {
|
||||
ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_payload]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *n4_message_payload_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(n4_information->n4_message_payload);
|
||||
if (n4_message_payload_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_payload]");
|
||||
|
|
@ -77,31 +93,32 @@ end:
|
|||
OpenAPI_n4_information_t *OpenAPI_n4_information_parseFromJSON(cJSON *n4_informationJSON)
|
||||
{
|
||||
OpenAPI_n4_information_t *n4_information_local_var = NULL;
|
||||
cJSON *n4_message_type = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4MessageType");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *n4_message_type = NULL;
|
||||
OpenAPI_n4_message_type_e n4_message_typeVariable = 0;
|
||||
cJSON *n4_message_payload = NULL;
|
||||
OpenAPI_ref_to_binary_data_t *n4_message_payload_local_nonprim = NULL;
|
||||
cJSON *n4_dnai_info = NULL;
|
||||
OpenAPI_dnai_information_t *n4_dnai_info_local_nonprim = NULL;
|
||||
n4_message_type = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4MessageType");
|
||||
if (!n4_message_type) {
|
||||
ogs_error("OpenAPI_n4_information_parseFromJSON() failed [n4_message_type]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_n4_message_type_e n4_message_typeVariable;
|
||||
if (!cJSON_IsString(n4_message_type)) {
|
||||
ogs_error("OpenAPI_n4_information_parseFromJSON() failed [n4_message_type]");
|
||||
goto end;
|
||||
}
|
||||
n4_message_typeVariable = OpenAPI_n4_message_type_FromString(n4_message_type->valuestring);
|
||||
|
||||
cJSON *n4_message_payload = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4MessagePayload");
|
||||
n4_message_payload = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4MessagePayload");
|
||||
if (!n4_message_payload) {
|
||||
ogs_error("OpenAPI_n4_information_parseFromJSON() failed [n4_message_payload]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_ref_to_binary_data_t *n4_message_payload_local_nonprim = NULL;
|
||||
n4_message_payload_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n4_message_payload);
|
||||
|
||||
cJSON *n4_dnai_info = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4DnaiInfo");
|
||||
|
||||
OpenAPI_dnai_information_t *n4_dnai_info_local_nonprim = NULL;
|
||||
n4_dnai_info = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4DnaiInfo");
|
||||
if (n4_dnai_info) {
|
||||
n4_dnai_info_local_nonprim = OpenAPI_dnai_information_parseFromJSON(n4_dnai_info);
|
||||
}
|
||||
|
|
@ -114,6 +131,14 @@ OpenAPI_n4_information_t *OpenAPI_n4_information_parseFromJSON(cJSON *n4_informa
|
|||
|
||||
return n4_information_local_var;
|
||||
end:
|
||||
if (n4_message_payload_local_nonprim) {
|
||||
OpenAPI_ref_to_binary_data_free(n4_message_payload_local_nonprim);
|
||||
n4_message_payload_local_nonprim = NULL;
|
||||
}
|
||||
if (n4_dnai_info_local_nonprim) {
|
||||
OpenAPI_dnai_information_free(n4_dnai_info_local_nonprim);
|
||||
n4_dnai_info_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue