mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +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
|
|
@ -22,18 +22,26 @@ OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_create(
|
|||
|
||||
void OpenAPI_point_uncertainty_circle_free(OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == point_uncertainty_circle) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_supported_gad_shapes_free(point_uncertainty_circle->shape);
|
||||
OpenAPI_geographical_coordinates_free(point_uncertainty_circle->point);
|
||||
if (point_uncertainty_circle->shape) {
|
||||
OpenAPI_supported_gad_shapes_free(point_uncertainty_circle->shape);
|
||||
point_uncertainty_circle->shape = NULL;
|
||||
}
|
||||
if (point_uncertainty_circle->point) {
|
||||
OpenAPI_geographical_coordinates_free(point_uncertainty_circle->point);
|
||||
point_uncertainty_circle->point = NULL;
|
||||
}
|
||||
ogs_free(point_uncertainty_circle);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_point_uncertainty_circle_convertToJSON(OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (point_uncertainty_circle == NULL) {
|
||||
ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [PointUncertaintyCircle]");
|
||||
|
|
@ -41,6 +49,10 @@ cJSON *OpenAPI_point_uncertainty_circle_convertToJSON(OpenAPI_point_uncertainty_
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!point_uncertainty_circle->shape) {
|
||||
ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [shape]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point_uncertainty_circle->shape);
|
||||
if (shape_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [shape]");
|
||||
|
|
@ -52,6 +64,10 @@ cJSON *OpenAPI_point_uncertainty_circle_convertToJSON(OpenAPI_point_uncertainty_
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (!point_uncertainty_circle->point) {
|
||||
ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [point]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_uncertainty_circle->point);
|
||||
if (point_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [point]");
|
||||
|
|
@ -75,30 +91,31 @@ end:
|
|||
OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_parseFromJSON(cJSON *point_uncertainty_circleJSON)
|
||||
{
|
||||
OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle_local_var = NULL;
|
||||
cJSON *shape = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "shape");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *shape = NULL;
|
||||
OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL;
|
||||
cJSON *point = NULL;
|
||||
OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL;
|
||||
cJSON *uncertainty = NULL;
|
||||
shape = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "shape");
|
||||
if (!shape) {
|
||||
ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [shape]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL;
|
||||
shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape);
|
||||
|
||||
cJSON *point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "point");
|
||||
point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "point");
|
||||
if (!point) {
|
||||
ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [point]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL;
|
||||
point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point);
|
||||
|
||||
cJSON *uncertainty = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "uncertainty");
|
||||
uncertainty = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "uncertainty");
|
||||
if (!uncertainty) {
|
||||
ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [uncertainty]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!cJSON_IsNumber(uncertainty)) {
|
||||
ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [uncertainty]");
|
||||
goto end;
|
||||
|
|
@ -113,6 +130,14 @@ OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_parseFromJS
|
|||
|
||||
return point_uncertainty_circle_local_var;
|
||||
end:
|
||||
if (shape_local_nonprim) {
|
||||
OpenAPI_supported_gad_shapes_free(shape_local_nonprim);
|
||||
shape_local_nonprim = NULL;
|
||||
}
|
||||
if (point_local_nonprim) {
|
||||
OpenAPI_geographical_coordinates_free(point_local_nonprim);
|
||||
point_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue