open5gs/lib/sbi
Sukchan Lee d16c9e5d6d sbi: Fix NULL list-add abort on map values of type DateTime/array
OpenAPI_nf_profile_parseFromJSON() aborts via ogs_assert(data) in
listEntry_create() when an NFProfile carries a non-empty
nfSetRecoveryTimeList / serviceSetRecoveryTimeList. OSS-Fuzz:

  listEntry_create: Assertion `data' failed (lib/sbi/openapi/src/list.c:10)
  OpenAPI_list_add (list.c:116)
  OpenAPI_nf_profile_parseFromJSON (nf_profile.c:3989)

Root cause is in the model-body.mustache map handler. The per-value
type dispatch only emits assignments to localMapKeyPair for
isString / isByteArray / isNumeric / isBoolean. For a map whose value
is a DateTime (map<string,DateTime>, e.g. NfSetRecoveryTimeList) or an
array (map<string,array<string>>, e.g. allowedOperationsPerNfType),
no branch fires, localMapKeyPair stays NULL, and the generated code
calls OpenAPI_list_add(list, NULL) -> listEntry_create(NULL) -> abort.
This is remotely triggerable: NFProfile is parsed from peer/NRF input.

Template fix (r19, openapitools 7.20.0):
  - add isDate / isDateTime branches in both parseFromJSON and
    convertToJSON map blocks (DateTime is carried as a JSON string,
    handled like isString); convertToJSON previously also dropped the
    value silently for these maps.
  - guard OpenAPI_list_add with a NULL check so any remaining
    unhandled value category (e.g. array-valued maps) fails the parse
    gracefully instead of aborting the process.

Regenerated the two affected models (nf_profile, nf_service).
DateTime maps now round-trip correctly; the array-valued maps are
rejected instead of crashing pending full map<string,array> support.

Issues: #4649
2026-06-28 08:34:51 +09:00
..
contrib Add only one 5GC scenario (call-flow) 2020-06-17 01:22:28 -04:00
custom [SBI] Fix parsing and serialization of _links "item" array (#3897) 2025-05-18 14:32:39 +09:00
openapi sbi: Fix NULL list-add abort on map values of type DateTime/array 2026-06-28 08:34:51 +09:00
support sbi: Fix NULL list-add abort on map values of type DateTime/array 2026-06-28 08:34:51 +09:00
client.c merge main branch 2026-06-10 09:07:45 +09:00
client.h Merge branch 'main' into home-routed 2025-04-06 18:36:57 +09:00
context.c sbi: share NF status subscription lookup 2026-06-27 08:44:16 +09:00
context.h sbi: share NF status subscription lookup 2026-06-27 08:44:16 +09:00
conv.c merge main branch 2026-06-10 09:07:45 +09:00
conv.h [NRF] Implemented PLMN list update handling in nrf_nnrf_handle_nf_update (#3566) 2024-12-26 14:38:00 +09:00
meson.build [SBI] Fixed openapitools MAP generation (#2103) 2023-02-26 10:01:08 +09:00
message.c pcf: send TerminationInfo body in policyauthorization terminate notify 2026-06-20 22:21:26 +09:00
message.h pcf: send TerminationInfo body in policyauthorization terminate notify 2026-06-20 22:21:26 +09:00
mhd-server.c merge main branch 2026-06-10 09:07:45 +09:00
nf-sm.c sbi: share NF status subscription lookup 2026-06-27 08:44:16 +09:00
nf-sm.h [SBI] SearchResult.validityPeriod 3600->30s (#3210) 2024-05-17 14:54:32 +09:00
nghttp2-server.c merge main branch 2026-06-10 09:07:45 +09:00
nnrf-build.c merge main branch 2026-06-10 09:07:45 +09:00
nnrf-build.h sbi: update SBI implementation to 3GPP Release-19 2026-04-06 17:55:54 +09:00
nnrf-handler.c sbi: reject unconfirmed NF status notifications 2026-06-27 08:44:16 +09:00
nnrf-handler.h merge main branch 2026-06-10 09:07:45 +09:00
nnrf-path.c merge main branch 2026-06-10 09:07:45 +09:00
nnrf-path.h merge main branch 2026-06-10 09:07:45 +09:00
ogs-sbi.h pcf: send TerminationInfo body in policyauthorization terminate notify 2026-06-20 22:21:26 +09:00
path.c merge main branch 2026-06-10 09:07:45 +09:00
path.h sbi: update SBI implementation to 3GPP Release-19 2026-04-06 17:55:54 +09:00
server.c merge main branch 2026-06-10 09:07:45 +09:00
server.h merge main branch 2026-06-10 09:07:45 +09:00
timer.c [SBI] Added Handler for Subscription PATCH (#2152) 2023-03-12 22:06:19 +09:00
timer.h [SBI] Added Handler for Subscription PATCH (#2152) 2023-03-12 22:06:19 +09:00
types.c sbi: update SBI implementation to 3GPP Release-19 2026-04-06 17:55:54 +09:00
types.h sbi: update SBI implementation to 3GPP Release-19 2026-04-06 17:55:54 +09:00
yuarel.c Added NRF 2020-05-18 17:00:37 -04:00
yuarel.h Added NRF 2020-05-18 17:00:37 -04:00