[SBI] Crash occurs when ENUM in the MAP (#2103)

This commit is contained in:
Sukchan Lee 2023-03-01 17:50:25 +09:00
parent ce668c556c
commit 969c116e77
1097 changed files with 266728 additions and 42047 deletions

View file

@ -20,18 +20,26 @@ OpenAPI_frame_route_info_1_t *OpenAPI_frame_route_info_1_create(
void OpenAPI_frame_route_info_1_free(OpenAPI_frame_route_info_1_t *frame_route_info_1)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == frame_route_info_1) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(frame_route_info_1->ipv4_mask);
ogs_free(frame_route_info_1->ipv6_prefix);
if (frame_route_info_1->ipv4_mask) {
ogs_free(frame_route_info_1->ipv4_mask);
frame_route_info_1->ipv4_mask = NULL;
}
if (frame_route_info_1->ipv6_prefix) {
ogs_free(frame_route_info_1->ipv6_prefix);
frame_route_info_1->ipv6_prefix = NULL;
}
ogs_free(frame_route_info_1);
}
cJSON *OpenAPI_frame_route_info_1_convertToJSON(OpenAPI_frame_route_info_1_t *frame_route_info_1)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (frame_route_info_1 == NULL) {
ogs_error("OpenAPI_frame_route_info_1_convertToJSON() failed [FrameRouteInfo_1]");
@ -60,27 +68,28 @@ end:
OpenAPI_frame_route_info_1_t *OpenAPI_frame_route_info_1_parseFromJSON(cJSON *frame_route_info_1JSON)
{
OpenAPI_frame_route_info_1_t *frame_route_info_1_local_var = NULL;
cJSON *ipv4_mask = cJSON_GetObjectItemCaseSensitive(frame_route_info_1JSON, "ipv4Mask");
OpenAPI_lnode_t *node = NULL;
cJSON *ipv4_mask = NULL;
cJSON *ipv6_prefix = NULL;
ipv4_mask = cJSON_GetObjectItemCaseSensitive(frame_route_info_1JSON, "ipv4Mask");
if (ipv4_mask) {
if (!cJSON_IsString(ipv4_mask)) {
if (!cJSON_IsString(ipv4_mask) && !cJSON_IsNull(ipv4_mask)) {
ogs_error("OpenAPI_frame_route_info_1_parseFromJSON() failed [ipv4_mask]");
goto end;
}
}
cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(frame_route_info_1JSON, "ipv6Prefix");
ipv6_prefix = cJSON_GetObjectItemCaseSensitive(frame_route_info_1JSON, "ipv6Prefix");
if (ipv6_prefix) {
if (!cJSON_IsString(ipv6_prefix)) {
if (!cJSON_IsString(ipv6_prefix) && !cJSON_IsNull(ipv6_prefix)) {
ogs_error("OpenAPI_frame_route_info_1_parseFromJSON() failed [ipv6_prefix]");
goto end;
}
}
frame_route_info_1_local_var = OpenAPI_frame_route_info_1_create (
ipv4_mask ? ogs_strdup(ipv4_mask->valuestring) : NULL,
ipv6_prefix ? ogs_strdup(ipv6_prefix->valuestring) : NULL
ipv4_mask && !cJSON_IsNull(ipv4_mask) ? ogs_strdup(ipv4_mask->valuestring) : NULL,
ipv6_prefix && !cJSON_IsNull(ipv6_prefix) ? ogs_strdup(ipv6_prefix->valuestring) : NULL
);
return frame_route_info_1_local_var;