mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 23:37:22 +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
|
|
@ -26,18 +26,26 @@ OpenAPI_up_path_chg_event_t *OpenAPI_up_path_chg_event_create(
|
|||
|
||||
void OpenAPI_up_path_chg_event_free(OpenAPI_up_path_chg_event_t *up_path_chg_event)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == up_path_chg_event) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(up_path_chg_event->notification_uri);
|
||||
ogs_free(up_path_chg_event->notif_corre_id);
|
||||
if (up_path_chg_event->notification_uri) {
|
||||
ogs_free(up_path_chg_event->notification_uri);
|
||||
up_path_chg_event->notification_uri = NULL;
|
||||
}
|
||||
if (up_path_chg_event->notif_corre_id) {
|
||||
ogs_free(up_path_chg_event->notif_corre_id);
|
||||
up_path_chg_event->notif_corre_id = NULL;
|
||||
}
|
||||
ogs_free(up_path_chg_event);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_up_path_chg_event_convertToJSON(OpenAPI_up_path_chg_event_t *up_path_chg_event)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (up_path_chg_event == NULL) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [UpPathChgEvent]");
|
||||
|
|
@ -45,16 +53,28 @@ cJSON *OpenAPI_up_path_chg_event_convertToJSON(OpenAPI_up_path_chg_event_t *up_p
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!up_path_chg_event->notification_uri) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [notification_uri]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "notificationUri", up_path_chg_event->notification_uri) == NULL) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [notification_uri]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!up_path_chg_event->notif_corre_id) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [notif_corre_id]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "notifCorreId", up_path_chg_event->notif_corre_id) == NULL) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [notif_corre_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (up_path_chg_event->dnai_chg_type == OpenAPI_dnai_change_type_NULL) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [dnai_chg_type]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "dnaiChgType", OpenAPI_dnai_change_type_ToString(up_path_chg_event->dnai_chg_type)) == NULL) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [dnai_chg_type]");
|
||||
goto end;
|
||||
|
|
@ -74,43 +94,44 @@ end:
|
|||
OpenAPI_up_path_chg_event_t *OpenAPI_up_path_chg_event_parseFromJSON(cJSON *up_path_chg_eventJSON)
|
||||
{
|
||||
OpenAPI_up_path_chg_event_t *up_path_chg_event_local_var = NULL;
|
||||
cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "notificationUri");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *notification_uri = NULL;
|
||||
cJSON *notif_corre_id = NULL;
|
||||
cJSON *dnai_chg_type = NULL;
|
||||
OpenAPI_dnai_change_type_e dnai_chg_typeVariable = 0;
|
||||
cJSON *af_ack_ind = NULL;
|
||||
notification_uri = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "notificationUri");
|
||||
if (!notification_uri) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [notification_uri]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!cJSON_IsString(notification_uri)) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [notification_uri]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON *notif_corre_id = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "notifCorreId");
|
||||
notif_corre_id = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "notifCorreId");
|
||||
if (!notif_corre_id) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [notif_corre_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!cJSON_IsString(notif_corre_id)) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [notif_corre_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON *dnai_chg_type = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "dnaiChgType");
|
||||
dnai_chg_type = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "dnaiChgType");
|
||||
if (!dnai_chg_type) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [dnai_chg_type]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_dnai_change_type_e dnai_chg_typeVariable;
|
||||
if (!cJSON_IsString(dnai_chg_type)) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [dnai_chg_type]");
|
||||
goto end;
|
||||
}
|
||||
dnai_chg_typeVariable = OpenAPI_dnai_change_type_FromString(dnai_chg_type->valuestring);
|
||||
|
||||
cJSON *af_ack_ind = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "afAckInd");
|
||||
|
||||
af_ack_ind = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "afAckInd");
|
||||
if (af_ack_ind) {
|
||||
if (!cJSON_IsBool(af_ack_ind)) {
|
||||
ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [af_ack_ind]");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue