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
|
|
@ -32,24 +32,50 @@ OpenAPI_pp_data_t *OpenAPI_pp_data_create(
|
|||
|
||||
void OpenAPI_pp_data_free(OpenAPI_pp_data_t *pp_data)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == pp_data) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_communication_characteristics_free(pp_data->communication_characteristics);
|
||||
ogs_free(pp_data->supported_features);
|
||||
OpenAPI_expected_ue_behaviour_free(pp_data->expected_ue_behaviour_parameters);
|
||||
OpenAPI_ec_restriction_free(pp_data->ec_restriction);
|
||||
OpenAPI_acs_info_rm_free(pp_data->acs_info);
|
||||
ogs_free(pp_data->stn_sr);
|
||||
OpenAPI_lcs_privacy_free(pp_data->lcs_privacy);
|
||||
OpenAPI_sor_info_free(pp_data->sor_info);
|
||||
if (pp_data->communication_characteristics) {
|
||||
OpenAPI_communication_characteristics_free(pp_data->communication_characteristics);
|
||||
pp_data->communication_characteristics = NULL;
|
||||
}
|
||||
if (pp_data->supported_features) {
|
||||
ogs_free(pp_data->supported_features);
|
||||
pp_data->supported_features = NULL;
|
||||
}
|
||||
if (pp_data->expected_ue_behaviour_parameters) {
|
||||
OpenAPI_expected_ue_behaviour_free(pp_data->expected_ue_behaviour_parameters);
|
||||
pp_data->expected_ue_behaviour_parameters = NULL;
|
||||
}
|
||||
if (pp_data->ec_restriction) {
|
||||
OpenAPI_ec_restriction_free(pp_data->ec_restriction);
|
||||
pp_data->ec_restriction = NULL;
|
||||
}
|
||||
if (pp_data->acs_info) {
|
||||
OpenAPI_acs_info_rm_free(pp_data->acs_info);
|
||||
pp_data->acs_info = NULL;
|
||||
}
|
||||
if (pp_data->stn_sr) {
|
||||
ogs_free(pp_data->stn_sr);
|
||||
pp_data->stn_sr = NULL;
|
||||
}
|
||||
if (pp_data->lcs_privacy) {
|
||||
OpenAPI_lcs_privacy_free(pp_data->lcs_privacy);
|
||||
pp_data->lcs_privacy = NULL;
|
||||
}
|
||||
if (pp_data->sor_info) {
|
||||
OpenAPI_sor_info_free(pp_data->sor_info);
|
||||
pp_data->sor_info = NULL;
|
||||
}
|
||||
ogs_free(pp_data);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_pp_data_convertToJSON(OpenAPI_pp_data_t *pp_data)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (pp_data == NULL) {
|
||||
ogs_error("OpenAPI_pp_data_convertToJSON() failed [PpData]");
|
||||
|
|
@ -156,79 +182,104 @@ end:
|
|||
OpenAPI_pp_data_t *OpenAPI_pp_data_parseFromJSON(cJSON *pp_dataJSON)
|
||||
{
|
||||
OpenAPI_pp_data_t *pp_data_local_var = NULL;
|
||||
cJSON *communication_characteristics = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "communicationCharacteristics");
|
||||
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *communication_characteristics = NULL;
|
||||
OpenAPI_communication_characteristics_t *communication_characteristics_local_nonprim = NULL;
|
||||
cJSON *supported_features = NULL;
|
||||
cJSON *expected_ue_behaviour_parameters = NULL;
|
||||
OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_parameters_local_nonprim = NULL;
|
||||
cJSON *ec_restriction = NULL;
|
||||
OpenAPI_ec_restriction_t *ec_restriction_local_nonprim = NULL;
|
||||
cJSON *acs_info = NULL;
|
||||
OpenAPI_acs_info_rm_t *acs_info_local_nonprim = NULL;
|
||||
cJSON *stn_sr = NULL;
|
||||
cJSON *lcs_privacy = NULL;
|
||||
OpenAPI_lcs_privacy_t *lcs_privacy_local_nonprim = NULL;
|
||||
cJSON *sor_info = NULL;
|
||||
OpenAPI_sor_info_t *sor_info_local_nonprim = NULL;
|
||||
communication_characteristics = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "communicationCharacteristics");
|
||||
if (communication_characteristics) {
|
||||
communication_characteristics_local_nonprim = OpenAPI_communication_characteristics_parseFromJSON(communication_characteristics);
|
||||
}
|
||||
|
||||
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "supportedFeatures");
|
||||
|
||||
supported_features = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "supportedFeatures");
|
||||
if (supported_features) {
|
||||
if (!cJSON_IsString(supported_features)) {
|
||||
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
|
||||
ogs_error("OpenAPI_pp_data_parseFromJSON() failed [supported_features]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *expected_ue_behaviour_parameters = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "expectedUeBehaviourParameters");
|
||||
|
||||
OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_parameters_local_nonprim = NULL;
|
||||
expected_ue_behaviour_parameters = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "expectedUeBehaviourParameters");
|
||||
if (expected_ue_behaviour_parameters) {
|
||||
expected_ue_behaviour_parameters_local_nonprim = OpenAPI_expected_ue_behaviour_parseFromJSON(expected_ue_behaviour_parameters);
|
||||
}
|
||||
|
||||
cJSON *ec_restriction = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "ecRestriction");
|
||||
|
||||
OpenAPI_ec_restriction_t *ec_restriction_local_nonprim = NULL;
|
||||
ec_restriction = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "ecRestriction");
|
||||
if (ec_restriction) {
|
||||
ec_restriction_local_nonprim = OpenAPI_ec_restriction_parseFromJSON(ec_restriction);
|
||||
}
|
||||
|
||||
cJSON *acs_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "acsInfo");
|
||||
|
||||
OpenAPI_acs_info_rm_t *acs_info_local_nonprim = NULL;
|
||||
acs_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "acsInfo");
|
||||
if (acs_info) {
|
||||
acs_info_local_nonprim = OpenAPI_acs_info_rm_parseFromJSON(acs_info);
|
||||
}
|
||||
|
||||
cJSON *stn_sr = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "stnSr");
|
||||
|
||||
stn_sr = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "stnSr");
|
||||
if (stn_sr) {
|
||||
if (!cJSON_IsString(stn_sr)) {
|
||||
if (!cJSON_IsString(stn_sr) && !cJSON_IsNull(stn_sr)) {
|
||||
ogs_error("OpenAPI_pp_data_parseFromJSON() failed [stn_sr]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *lcs_privacy = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "lcsPrivacy");
|
||||
|
||||
OpenAPI_lcs_privacy_t *lcs_privacy_local_nonprim = NULL;
|
||||
lcs_privacy = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "lcsPrivacy");
|
||||
if (lcs_privacy) {
|
||||
lcs_privacy_local_nonprim = OpenAPI_lcs_privacy_parseFromJSON(lcs_privacy);
|
||||
}
|
||||
|
||||
cJSON *sor_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "sorInfo");
|
||||
|
||||
OpenAPI_sor_info_t *sor_info_local_nonprim = NULL;
|
||||
sor_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "sorInfo");
|
||||
if (sor_info) {
|
||||
sor_info_local_nonprim = OpenAPI_sor_info_parseFromJSON(sor_info);
|
||||
}
|
||||
|
||||
pp_data_local_var = OpenAPI_pp_data_create (
|
||||
communication_characteristics ? communication_characteristics_local_nonprim : NULL,
|
||||
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
expected_ue_behaviour_parameters ? expected_ue_behaviour_parameters_local_nonprim : NULL,
|
||||
ec_restriction ? ec_restriction_local_nonprim : NULL,
|
||||
acs_info ? acs_info_local_nonprim : NULL,
|
||||
stn_sr ? ogs_strdup(stn_sr->valuestring) : NULL,
|
||||
stn_sr && !cJSON_IsNull(stn_sr) ? ogs_strdup(stn_sr->valuestring) : NULL,
|
||||
lcs_privacy ? lcs_privacy_local_nonprim : NULL,
|
||||
sor_info ? sor_info_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return pp_data_local_var;
|
||||
end:
|
||||
if (communication_characteristics_local_nonprim) {
|
||||
OpenAPI_communication_characteristics_free(communication_characteristics_local_nonprim);
|
||||
communication_characteristics_local_nonprim = NULL;
|
||||
}
|
||||
if (expected_ue_behaviour_parameters_local_nonprim) {
|
||||
OpenAPI_expected_ue_behaviour_free(expected_ue_behaviour_parameters_local_nonprim);
|
||||
expected_ue_behaviour_parameters_local_nonprim = NULL;
|
||||
}
|
||||
if (ec_restriction_local_nonprim) {
|
||||
OpenAPI_ec_restriction_free(ec_restriction_local_nonprim);
|
||||
ec_restriction_local_nonprim = NULL;
|
||||
}
|
||||
if (acs_info_local_nonprim) {
|
||||
OpenAPI_acs_info_rm_free(acs_info_local_nonprim);
|
||||
acs_info_local_nonprim = NULL;
|
||||
}
|
||||
if (lcs_privacy_local_nonprim) {
|
||||
OpenAPI_lcs_privacy_free(lcs_privacy_local_nonprim);
|
||||
lcs_privacy_local_nonprim = NULL;
|
||||
}
|
||||
if (sor_info_local_nonprim) {
|
||||
OpenAPI_sor_info_free(sor_info_local_nonprim);
|
||||
sor_info_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue