mirror of
https://github.com/open5gs/open5gs.git
synced 2026-08-31 01:45:31 +00:00
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
|
||
|---|---|---|
| .. | ||
| contrib | ||
| custom | ||
| openapi | ||
| support | ||
| client.c | ||
| client.h | ||
| context.c | ||
| context.h | ||
| conv.c | ||
| conv.h | ||
| meson.build | ||
| message.c | ||
| message.h | ||
| mhd-server.c | ||
| nf-sm.c | ||
| nf-sm.h | ||
| nghttp2-server.c | ||
| nnrf-build.c | ||
| nnrf-build.h | ||
| nnrf-handler.c | ||
| nnrf-handler.h | ||
| nnrf-path.c | ||
| nnrf-path.h | ||
| ogs-sbi.h | ||
| path.c | ||
| path.h | ||
| server.c | ||
| server.h | ||
| timer.c | ||
| timer.h | ||
| types.c | ||
| types.h | ||
| yuarel.c | ||
| yuarel.h | ||