Change in osmo-msc[master]: msc_tx_common_id(): fix potential NULL pointer dereference

fixeria gerrit-no-reply at lists.osmocom.org
Sun Jun 6 13:51:05 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/24575 )


Change subject: msc_tx_common_id(): fix potential NULL pointer dereference
......................................................................

msc_tx_common_id(): fix potential NULL pointer dereference

Reported by GCC 11.1.0.  msc_a_vsub() may return NULL.

Change-Id: Iebdd6399e819a03258398e6b7b453bda37e45a20
---
M src/libmsc/msc_a.c
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/75/24575/1

diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 391d251..05030d3 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1638,6 +1638,8 @@
 int msc_tx_common_id(struct msc_a *msc_a, enum msc_role to_role)
 {
 	struct vlr_subscr *vsub = msc_a_vsub(msc_a);
+	if (vsub == NULL)
+		return -ENODEV;
 	struct ran_msg msg = {
 		.msg_type = RAN_MSG_COMMON_ID,
 		.common_id = {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/24575
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Iebdd6399e819a03258398e6b7b453bda37e45a20
Gerrit-Change-Number: 24575
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210606/5ab51528/attachment.htm>


More information about the gerrit-log mailing list