open5gs/lib/sbi/openapi
Sukchan Lee 0abfb204ea [SBI] crash when enum is unknown (#2622)
j
The crash is caused by ogs_assert(data) in listEntry_create(void *data).
Reason for the failing assertion is that in

OpenAPI_subscription_data_t *OpenAPI_subscription_data_parseFromJSON(
        cJSON *subscription_dataJSON)

in line 501 of file subscription_data.c the event string is transformed
into an integer/enum value, which in case of an unknown event is 0.

Steps to reproduce:

1. Deploy NRF
2. Run curl --http2-prior-knowledge --header "Content-Type: application/json" --data '{"nfStatusNotificationUri": "test@example.com", "reqNotifEvents": ["unknown"], "subscriptionId": "12345"}' "http://<NRF_IP>:<NRF_PORT>/nnrf-nfm/v1/subscriptions"
2023-09-24 09:56:40 +09:00
..
.openapi-generator [SBI] Crash occurs when ENUM in the MAP (#2103) 2023-03-01 17:50:25 +09:00
external [SBI] Crash occurs when ENUM in the MAP (#2103) 2023-03-01 17:50:25 +09:00
include OpenAPI: Add functions OpenAPI_list_clear and OpenAPI_list_insert_prev 2022-11-29 23:10:49 +09:00
model [SBI] crash when enum is unknown (#2622) 2023-09-24 09:56:40 +09:00
src OpenAPI: Add functions OpenAPI_list_clear and OpenAPI_list_insert_prev 2022-11-29 23:10:49 +09:00
.openapi-generator-ignore Upgrade SBI(Service-based Interface) 2021-07-07 17:32:55 +09:00
meson.build Added N32 Interface to implement SEPP 2023-03-05 22:55:36 +09:00
set.h [SBI] Crash occurs when ENUM in the MAP (#2103) 2023-03-01 17:50:25 +09:00