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

fixeria gerrit-no-reply at lists.osmocom.org
Mon Jun 7 14:50:43 UTC 2021


fixeria has submitted this change. ( 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(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



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-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210607/4c83861d/attachment.htm>


More information about the gerrit-log mailing list