mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 21:30:10 +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
|
|
@ -20,16 +20,18 @@ OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_create(
|
|||
|
||||
void OpenAPI_nr_v2x_auth_free(OpenAPI_nr_v2x_auth_t *nr_v2x_auth)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == nr_v2x_auth) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(nr_v2x_auth);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_nr_v2x_auth_convertToJSON(OpenAPI_nr_v2x_auth_t *nr_v2x_auth)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (nr_v2x_auth == NULL) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [NrV2xAuth]");
|
||||
|
|
@ -37,14 +39,14 @@ cJSON *OpenAPI_nr_v2x_auth_convertToJSON(OpenAPI_nr_v2x_auth_t *nr_v2x_auth)
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (nr_v2x_auth->vehicle_ue_auth) {
|
||||
if (nr_v2x_auth->vehicle_ue_auth != OpenAPI_ue_auth_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "vehicleUeAuth", OpenAPI_ue_auth_ToString(nr_v2x_auth->vehicle_ue_auth)) == NULL) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [vehicle_ue_auth]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (nr_v2x_auth->pedestrian_ue_auth) {
|
||||
if (nr_v2x_auth->pedestrian_ue_auth != OpenAPI_ue_auth_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "pedestrianUeAuth", OpenAPI_ue_auth_ToString(nr_v2x_auth->pedestrian_ue_auth)) == NULL) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [pedestrian_ue_auth]");
|
||||
goto end;
|
||||
|
|
@ -58,9 +60,12 @@ end:
|
|||
OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_parseFromJSON(cJSON *nr_v2x_authJSON)
|
||||
{
|
||||
OpenAPI_nr_v2x_auth_t *nr_v2x_auth_local_var = NULL;
|
||||
cJSON *vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "vehicleUeAuth");
|
||||
|
||||
OpenAPI_ue_auth_e vehicle_ue_authVariable;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *vehicle_ue_auth = NULL;
|
||||
OpenAPI_ue_auth_e vehicle_ue_authVariable = 0;
|
||||
cJSON *pedestrian_ue_auth = NULL;
|
||||
OpenAPI_ue_auth_e pedestrian_ue_authVariable = 0;
|
||||
vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "vehicleUeAuth");
|
||||
if (vehicle_ue_auth) {
|
||||
if (!cJSON_IsString(vehicle_ue_auth)) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_parseFromJSON() failed [vehicle_ue_auth]");
|
||||
|
|
@ -69,9 +74,7 @@ OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_parseFromJSON(cJSON *nr_v2x_authJSON)
|
|||
vehicle_ue_authVariable = OpenAPI_ue_auth_FromString(vehicle_ue_auth->valuestring);
|
||||
}
|
||||
|
||||
cJSON *pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "pedestrianUeAuth");
|
||||
|
||||
OpenAPI_ue_auth_e pedestrian_ue_authVariable;
|
||||
pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "pedestrianUeAuth");
|
||||
if (pedestrian_ue_auth) {
|
||||
if (!cJSON_IsString(pedestrian_ue_auth)) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_parseFromJSON() failed [pedestrian_ue_auth]");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue