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

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/.

dexter gerrit-no-reply at lists.osmocom.org
Thu Apr 4 08:40:02 UTC 2019


dexter has uploaded this change for review. ( 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, 3 insertions(+), 2 deletions(-)



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

diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c
index 450d552..c12c4cb 100644
--- a/src/libmsc/sgs_iface.c
+++ b/src/libmsc/sgs_iface.c
@@ -301,8 +301,9 @@
 
 	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: newchange
Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6
Gerrit-Change-Number: 13513
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190404/173d812b/attachment.htm>


More information about the gerrit-log mailing list