mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 06:10: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
|
|
@ -20,16 +20,18 @@ OpenAPI_eps_nas_security_mode_t *OpenAPI_eps_nas_security_mode_create(
|
|||
|
||||
void OpenAPI_eps_nas_security_mode_free(OpenAPI_eps_nas_security_mode_t *eps_nas_security_mode)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == eps_nas_security_mode) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(eps_nas_security_mode);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_eps_nas_security_mode_convertToJSON(OpenAPI_eps_nas_security_mode_t *eps_nas_security_mode)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (eps_nas_security_mode == NULL) {
|
||||
ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [EpsNasSecurityMode]");
|
||||
|
|
@ -37,11 +39,19 @@ cJSON *OpenAPI_eps_nas_security_mode_convertToJSON(OpenAPI_eps_nas_security_mode
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (eps_nas_security_mode->integrity_algorithm == OpenAPI_eps_nas_integrity_algorithm_NULL) {
|
||||
ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [integrity_algorithm]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "integrityAlgorithm", OpenAPI_eps_nas_integrity_algorithm_ToString(eps_nas_security_mode->integrity_algorithm)) == NULL) {
|
||||
ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [integrity_algorithm]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (eps_nas_security_mode->ciphering_algorithm == OpenAPI_eps_nas_ciphering_algorithm_NULL) {
|
||||
ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [ciphering_algorithm]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "cipheringAlgorithm", OpenAPI_eps_nas_ciphering_algorithm_ToString(eps_nas_security_mode->ciphering_algorithm)) == NULL) {
|
||||
ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [ciphering_algorithm]");
|
||||
goto end;
|
||||
|
|
@ -54,26 +64,27 @@ end:
|
|||
OpenAPI_eps_nas_security_mode_t *OpenAPI_eps_nas_security_mode_parseFromJSON(cJSON *eps_nas_security_modeJSON)
|
||||
{
|
||||
OpenAPI_eps_nas_security_mode_t *eps_nas_security_mode_local_var = NULL;
|
||||
cJSON *integrity_algorithm = cJSON_GetObjectItemCaseSensitive(eps_nas_security_modeJSON, "integrityAlgorithm");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *integrity_algorithm = NULL;
|
||||
OpenAPI_eps_nas_integrity_algorithm_e integrity_algorithmVariable = 0;
|
||||
cJSON *ciphering_algorithm = NULL;
|
||||
OpenAPI_eps_nas_ciphering_algorithm_e ciphering_algorithmVariable = 0;
|
||||
integrity_algorithm = cJSON_GetObjectItemCaseSensitive(eps_nas_security_modeJSON, "integrityAlgorithm");
|
||||
if (!integrity_algorithm) {
|
||||
ogs_error("OpenAPI_eps_nas_security_mode_parseFromJSON() failed [integrity_algorithm]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_eps_nas_integrity_algorithm_e integrity_algorithmVariable;
|
||||
if (!cJSON_IsString(integrity_algorithm)) {
|
||||
ogs_error("OpenAPI_eps_nas_security_mode_parseFromJSON() failed [integrity_algorithm]");
|
||||
goto end;
|
||||
}
|
||||
integrity_algorithmVariable = OpenAPI_eps_nas_integrity_algorithm_FromString(integrity_algorithm->valuestring);
|
||||
|
||||
cJSON *ciphering_algorithm = cJSON_GetObjectItemCaseSensitive(eps_nas_security_modeJSON, "cipheringAlgorithm");
|
||||
ciphering_algorithm = cJSON_GetObjectItemCaseSensitive(eps_nas_security_modeJSON, "cipheringAlgorithm");
|
||||
if (!ciphering_algorithm) {
|
||||
ogs_error("OpenAPI_eps_nas_security_mode_parseFromJSON() failed [ciphering_algorithm]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_eps_nas_ciphering_algorithm_e ciphering_algorithmVariable;
|
||||
if (!cJSON_IsString(ciphering_algorithm)) {
|
||||
ogs_error("OpenAPI_eps_nas_security_mode_parseFromJSON() failed [ciphering_algorithm]");
|
||||
goto end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue