laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/28481 )
Change subject: xua_snm: assert to guard against NULL ptr
......................................................................
xua_snm: assert to guard against NULL ptr
This is similarly done for same IE in other functions, so let's do it
here too in order to make coverity happy, and avoid random access ptr
probably ending up in obscure crash.
Fixes: Coverity CID#272994
Change-Id: I72059ffaa608bb4f5c4bd274645878e0b31ed6e0
---
M src/xua_snm.c
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/xua_snm.c b/src/xua_snm.c
index 1212162..c7d0d2e 100644
--- a/src/xua_snm.c
+++ b/src/xua_snm.c
@@ -464,6 +464,8 @@
const uint32_t *cong_level = xua_msg_get_u32p(xua, M3UA_IEI_CONG_IND, &_cong_level);
int log_ss = osmo_ss7_asp_get_log_subsys(asp);
+ OSMO_ASSERT(ie_aff_pc);
+
LOGPASP(asp, log_ss, LOGL_NOTICE, "RX SCON(%s) for %s level=%u\n", info_str ? info_str : "",
format_affected_pcs_c(xua, asp->inst, ie_aff_pc), cong_level ? *cong_level : 0);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/28481
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I72059ffaa608bb4f5c4bd274645878e0b31ed6e0
Gerrit-Change-Number: 28481
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Attention is currently required from: pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/28481 )
Change subject: xua_snm: assert to guard against NULL ptr
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
Patchset:
PS1:
note that we can only do this here because we have previous codee which will reject (gracefully, at protocol level) if messages without mandatory IEs are received. Otherwise we of course don't want to ASSERT in case of a missing IE.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/28481
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I72059ffaa608bb4f5c4bd274645878e0b31ed6e0
Gerrit-Change-Number: 28481
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 01 Jul 2022 14:23:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment