pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40244?usp=email )
Change subject: xua: Guard against osmo_fsm_inst_alloc() failures ...................................................................... xua: Guard against osmo_fsm_inst_alloc() failures This can happen for instance if the ASP name has a non-sanitized name. Change-Id: Ie5bd59c62f07a2656ddf5235450b9fd354eab7e0 --- M src/xua_as_fsm.c M src/xua_asp_fsm.c M src/xua_default_lm_fsm.c 3 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/44/40244/1 diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c index 7f7c7d6..5b01009 100644 --- a/src/xua_as_fsm.c +++ b/src/xua_as_fsm.c @@ -663,6 +663,8 @@ struct xua_as_fsm_priv *xafp; fi = osmo_fsm_inst_alloc(&xua_as_fsm, as, NULL, log_level, as->cfg.name); + if (!fi) + return NULL; xafp = talloc_zero(fi, struct xua_as_fsm_priv); if (!xafp) { diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c index 11a34b4..596db45 100644 --- a/src/xua_asp_fsm.c +++ b/src/xua_asp_fsm.c @@ -827,6 +827,8 @@ /* allocate as child of AS? */ fi = osmo_fsm_inst_alloc(&xua_asp_fsm, asp, NULL, log_level, asp->cfg.name); + if (!fi) + return -EINVAL; xafp = talloc_zero(fi, struct xua_asp_fsm_priv); if (!xafp) { @@ -1304,6 +1306,8 @@ /* allocate as child of AS? */ fi = osmo_fsm_inst_alloc(&ipa_asp_fsm, asp, NULL, log_level, asp->cfg.name); + if (!fi) + return -EINVAL; iafp = talloc_zero(fi, struct ipa_asp_fsm_priv); if (!iafp) { diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c index 3aceb26..2cf2010 100644 --- a/src/xua_default_lm_fsm.c +++ b/src/xua_default_lm_fsm.c @@ -429,6 +429,8 @@ } fi = osmo_fsm_inst_alloc(&xua_default_lm_fsm, asp, NULL, log_level, asp->cfg.name); + if (!fi) + return -EINVAL; lmp = talloc_zero(fi, struct lm_fsm_priv); if (!lmp) { -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40244?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: Ie5bd59c62f07a2656ddf5235450b9fd354eab7e0 Gerrit-Change-Number: 40244 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pes...@sysmocom.de>