mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 07:08:11 +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,20 +26,34 @@ OpenAPI_sor_info_1_t *OpenAPI_sor_info_1_create(
|
|||
|
||||
void OpenAPI_sor_info_1_free(OpenAPI_sor_info_1_t *sor_info_1)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == sor_info_1) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_steering_container_free(sor_info_1->steering_container);
|
||||
ogs_free(sor_info_1->sor_mac_iausf);
|
||||
ogs_free(sor_info_1->countersor);
|
||||
ogs_free(sor_info_1->provisioning_time);
|
||||
if (sor_info_1->steering_container) {
|
||||
OpenAPI_steering_container_free(sor_info_1->steering_container);
|
||||
sor_info_1->steering_container = NULL;
|
||||
}
|
||||
if (sor_info_1->sor_mac_iausf) {
|
||||
ogs_free(sor_info_1->sor_mac_iausf);
|
||||
sor_info_1->sor_mac_iausf = NULL;
|
||||
}
|
||||
if (sor_info_1->countersor) {
|
||||
ogs_free(sor_info_1->countersor);
|
||||
sor_info_1->countersor = NULL;
|
||||
}
|
||||
if (sor_info_1->provisioning_time) {
|
||||
ogs_free(sor_info_1->provisioning_time);
|
||||
sor_info_1->provisioning_time = NULL;
|
||||
}
|
||||
ogs_free(sor_info_1);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_sor_info_1_convertToJSON(OpenAPI_sor_info_1_t *sor_info_1)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (sor_info_1 == NULL) {
|
||||
ogs_error("OpenAPI_sor_info_1_convertToJSON() failed [SorInfo_1]");
|
||||
|
|
@ -79,6 +93,10 @@ cJSON *OpenAPI_sor_info_1_convertToJSON(OpenAPI_sor_info_1_t *sor_info_1)
|
|||
}
|
||||
}
|
||||
|
||||
if (!sor_info_1->provisioning_time) {
|
||||
ogs_error("OpenAPI_sor_info_1_convertToJSON() failed [provisioning_time]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "provisioningTime", sor_info_1->provisioning_time) == NULL) {
|
||||
ogs_error("OpenAPI_sor_info_1_convertToJSON() failed [provisioning_time]");
|
||||
goto end;
|
||||
|
|
@ -91,49 +109,50 @@ end:
|
|||
OpenAPI_sor_info_1_t *OpenAPI_sor_info_1_parseFromJSON(cJSON *sor_info_1JSON)
|
||||
{
|
||||
OpenAPI_sor_info_1_t *sor_info_1_local_var = NULL;
|
||||
cJSON *steering_container = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "steeringContainer");
|
||||
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *steering_container = NULL;
|
||||
OpenAPI_steering_container_t *steering_container_local_nonprim = NULL;
|
||||
cJSON *ack_ind = NULL;
|
||||
cJSON *sor_mac_iausf = NULL;
|
||||
cJSON *countersor = NULL;
|
||||
cJSON *provisioning_time = NULL;
|
||||
steering_container = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "steeringContainer");
|
||||
if (steering_container) {
|
||||
steering_container_local_nonprim = OpenAPI_steering_container_parseFromJSON(steering_container);
|
||||
}
|
||||
|
||||
cJSON *ack_ind = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "ackInd");
|
||||
ack_ind = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "ackInd");
|
||||
if (!ack_ind) {
|
||||
ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [ack_ind]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!cJSON_IsBool(ack_ind)) {
|
||||
ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [ack_ind]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON *sor_mac_iausf = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "sorMacIausf");
|
||||
|
||||
sor_mac_iausf = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "sorMacIausf");
|
||||
if (sor_mac_iausf) {
|
||||
if (!cJSON_IsString(sor_mac_iausf)) {
|
||||
if (!cJSON_IsString(sor_mac_iausf) && !cJSON_IsNull(sor_mac_iausf)) {
|
||||
ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [sor_mac_iausf]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *countersor = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "countersor");
|
||||
|
||||
countersor = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "countersor");
|
||||
if (countersor) {
|
||||
if (!cJSON_IsString(countersor)) {
|
||||
if (!cJSON_IsString(countersor) && !cJSON_IsNull(countersor)) {
|
||||
ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [countersor]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "provisioningTime");
|
||||
provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "provisioningTime");
|
||||
if (!provisioning_time) {
|
||||
ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [provisioning_time]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!cJSON_IsString(provisioning_time)) {
|
||||
if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) {
|
||||
ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [provisioning_time]");
|
||||
goto end;
|
||||
}
|
||||
|
|
@ -142,13 +161,17 @@ OpenAPI_sor_info_1_t *OpenAPI_sor_info_1_parseFromJSON(cJSON *sor_info_1JSON)
|
|||
steering_container ? steering_container_local_nonprim : NULL,
|
||||
|
||||
ack_ind->valueint,
|
||||
sor_mac_iausf ? ogs_strdup(sor_mac_iausf->valuestring) : NULL,
|
||||
countersor ? ogs_strdup(countersor->valuestring) : NULL,
|
||||
sor_mac_iausf && !cJSON_IsNull(sor_mac_iausf) ? ogs_strdup(sor_mac_iausf->valuestring) : NULL,
|
||||
countersor && !cJSON_IsNull(countersor) ? ogs_strdup(countersor->valuestring) : NULL,
|
||||
ogs_strdup(provisioning_time->valuestring)
|
||||
);
|
||||
|
||||
return sor_info_1_local_var;
|
||||
end:
|
||||
if (steering_container_local_nonprim) {
|
||||
OpenAPI_steering_container_free(steering_container_local_nonprim);
|
||||
steering_container_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue