Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Apr 11 07:32:48 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13513 )

Change subject: sgs_iface: fix nullpointer dereference
......................................................................

sgs_iface: fix nullpointer dereference

The function sgs_tx() is using the sgs connection pointer as context,
even though it has done a check for a nullpointer in the line before.
This is very prone to lead into a segfault when the SGs connection dies.

Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6
Related: OS#3859
---
M src/libmsc/sgs_iface.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Neels Hofmeyr: Looks good to me, but someone else must approve
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c
index 450d552..f64b191 100644
--- a/src/libmsc/sgs_iface.c
+++ b/src/libmsc/sgs_iface.c
@@ -301,8 +301,8 @@
 
 	msgb_sctp_ppid(msg) = 0;
 	if (!sgc) {
-		LOGSGC(sgc, LOGL_NOTICE, "Cannot transmit %s: connection dead. Discarding\n",
-		       sgsap_msg_type_name(msg->data[0]));
+		LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection dead. Discarding\n",
+		     sgsap_msg_type_name(msg->data[0]));
 		msgb_free(msg);
 		return;
 	}

-- 
To view, visit https://gerrit.osmocom.org/13513
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6
Gerrit-Change-Number: 13513
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190411/11596aeb/attachment.html>


More information about the gerrit-log mailing list