forked from acouzens/open5gs
[NRF] Fixed crash due to invalid PATCH body (#2735)
This commit is contained in:
parent
7278714133
commit
ab1c3493c6
|
@ -1393,6 +1393,11 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
}
|
}
|
||||||
|
|
||||||
patch_item = OpenAPI_patch_item_parseFromJSON(patchJSON);
|
patch_item = OpenAPI_patch_item_parseFromJSON(patchJSON);
|
||||||
|
if (!patch_item) {
|
||||||
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("No PatchItem");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
OpenAPI_list_add(message->PatchItemList, patch_item);
|
OpenAPI_list_add(message->PatchItemList, patch_item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1698,6 +1703,11 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
}
|
}
|
||||||
|
|
||||||
smsub_item = OpenAPI_session_management_subscription_data_parseFromJSON(smsubJSON);
|
smsub_item = OpenAPI_session_management_subscription_data_parseFromJSON(smsubJSON);
|
||||||
|
if (!smsub_item) {
|
||||||
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("No smsub_item");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
OpenAPI_list_add(message->SessionManagementSubscriptionDataList, smsub_item);
|
OpenAPI_list_add(message->SessionManagementSubscriptionDataList, smsub_item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1860,6 +1870,11 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
}
|
}
|
||||||
|
|
||||||
smsub_item = OpenAPI_session_management_subscription_data_parseFromJSON(smsubJSON);
|
smsub_item = OpenAPI_session_management_subscription_data_parseFromJSON(smsubJSON);
|
||||||
|
if (!smsub_item) {
|
||||||
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("No smsub_item");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
OpenAPI_list_add(message->SessionManagementSubscriptionDataList, smsub_item);
|
OpenAPI_list_add(message->SessionManagementSubscriptionDataList, smsub_item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3287,7 +3302,10 @@ int ogs_sbi_discovery_option_parse_plmn_list(
|
||||||
}
|
}
|
||||||
|
|
||||||
PlmnId = OpenAPI_plmn_id_parseFromJSON(PlmnIdJSON);
|
PlmnId = OpenAPI_plmn_id_parseFromJSON(PlmnIdJSON);
|
||||||
ogs_assert(PlmnId);
|
if (!PlmnId) {
|
||||||
|
ogs_error("No PlmnId");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
OpenAPI_list_add(PlmnList, PlmnId);
|
OpenAPI_list_add(PlmnList, PlmnId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,6 +726,10 @@ static int update_rat_res_add_one(cJSON *restriction,
|
||||||
}
|
}
|
||||||
|
|
||||||
restr = (void *) OpenAPI_rat_type_FromString(cJSON_GetStringValue(restriction));
|
restr = (void *) OpenAPI_rat_type_FromString(cJSON_GetStringValue(restriction));
|
||||||
|
if (!restr) {
|
||||||
|
ogs_error("No restr");
|
||||||
|
return OGS_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (index == restrictions->count) {
|
if (index == restrictions->count) {
|
||||||
OpenAPI_list_add(restrictions, restr);
|
OpenAPI_list_add(restrictions, restr);
|
||||||
|
|
|
@ -202,8 +202,10 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue,
|
||||||
LinksValueScheme = OpenAPI_map_create(
|
LinksValueScheme = OpenAPI_map_create(
|
||||||
(char *)links_member_name(UeAuthenticationCtx.auth_type),
|
(char *)links_member_name(UeAuthenticationCtx.auth_type),
|
||||||
&LinksValueSchemeValue);
|
&LinksValueSchemeValue);
|
||||||
|
ogs_assert(LinksValueScheme);
|
||||||
|
|
||||||
UeAuthenticationCtx._links = OpenAPI_list_create();
|
UeAuthenticationCtx._links = OpenAPI_list_create();
|
||||||
|
ogs_assert(UeAuthenticationCtx._links);
|
||||||
OpenAPI_list_add(UeAuthenticationCtx._links, LinksValueScheme);
|
OpenAPI_list_add(UeAuthenticationCtx._links, LinksValueScheme);
|
||||||
|
|
||||||
memset(&sendmsg, 0, sizeof(sendmsg));
|
memset(&sendmsg, 0, sizeof(sendmsg));
|
||||||
|
|
|
@ -893,6 +893,11 @@ bool nrf_nnrf_handle_nf_discover(
|
||||||
discovery_option->requester_features,
|
discovery_option->requester_features,
|
||||||
OGS_SBI_NNRF_DISC_SERVICE_MAP) ? true : false);
|
OGS_SBI_NNRF_DISC_SERVICE_MAP) ? true : false);
|
||||||
|
|
||||||
|
if (!NFProfile) {
|
||||||
|
ogs_error("No NFProfile");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
OpenAPI_list_add(SearchResult->nf_instances, NFProfile);
|
OpenAPI_list_add(SearchResult->nf_instances, NFProfile);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -696,6 +696,11 @@ bool udm_nudr_dr_handle_subscription_provisioned(
|
||||||
OpenAPI_session_management_subscription_data_t *item = NULL;
|
OpenAPI_session_management_subscription_data_t *item = NULL;
|
||||||
|
|
||||||
item = OpenAPI_session_management_subscription_data_copy(item, node->data);
|
item = OpenAPI_session_management_subscription_data_copy(item, node->data);
|
||||||
|
if (!item) {
|
||||||
|
ogs_error("OpenAPI_session_management_subscription_data_copy() "
|
||||||
|
"failed");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
OpenAPI_list_add(sendmsg.SessionManagementSubscriptionDataList, item);
|
OpenAPI_list_add(sendmsg.SessionManagementSubscriptionDataList, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue