[PATCH] libosmo-sccp[master]: sclc_rx_cldr(): Don't try to dereference user data_ie withou...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Apr 27 10:12:37 UTC 2017


Review at  https://gerrit.osmocom.org/2436

sclc_rx_cldr(): Don't try to dereference user data_ie without check

While the SUA / SCCP2SUA code is ensuring that mandatory information
elements such as the user data IE in a CLD$ message, we might still have
current or future callers of sclc_rx_cldr() that don't comply with that.
So let's make sure data_ie is valid before dereferencing it.

Change-Id: I7c1010b0ac82ee0b7bd5e2c7413899695eae0070
Fixes: coverity CID#166940
---
M src/sccp_sclc.c
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/36/2436/1

diff --git a/src/sccp_sclc.c b/src/sccp_sclc.c
index 262b2c0..8f9e577 100644
--- a/src/sccp_sclc.c
+++ b/src/sccp_sclc.c
@@ -204,6 +204,11 @@
 	struct msgb *upmsg = sccp_msgb_alloc(__func__);
 	struct osmo_sccp_user *scu;
 
+	if (!data_ie) {
+		LOGP(DLSCCP, LOGL_ERROR, "SCCP/SUA CLDR without user data?!?\n");
+		return -1;
+	}
+
 	/* fill primitive */
 	prim = (struct osmo_scu_prim *) msgb_put(upmsg, sizeof(*prim));
 	param = &prim->u.notice;

-- 
To view, visit https://gerrit.osmocom.org/2436
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c1010b0ac82ee0b7bd5e2c7413899695eae0070
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list