<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/13513">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sgs_iface: fix nullpointer dereference<br><br>The function sgs_tx() is using the sgs connection pointer as context,<br>even though it has done a check for a nullpointer in the line before.<br>This is very prone to lead into a segfault when the SGs connection dies.<br><br>Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6<br>Related: OS#3859<br>---<br>M src/libmsc/sgs_iface.c<br>1 file changed, 3 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/13/13513/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c</span><br><span>index 450d552..c12c4cb 100644</span><br><span>--- a/src/libmsc/sgs_iface.c</span><br><span>+++ b/src/libmsc/sgs_iface.c</span><br><span>@@ -301,8 +301,9 @@</span><br><span> </span><br><span>       msgb_sctp_ppid(msg) = 0;</span><br><span>     if (!sgc) {</span><br><span style="color: hsl(0, 100%, 40%);">-             LOGSGC(sgc, LOGL_NOTICE, "Cannot transmit %s: connection dead. Discarding\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                sgsap_msg_type_name(msg->data[0]));</span><br><span style="color: hsl(120, 100%, 40%);">+         LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection dead. Discarding\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                     sgsap_msg_type_name(msg->data[0]));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>                msgb_free(msg);</span><br><span>              return;</span><br><span>      }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/13513">change 13513</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/13513"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 </div>
<div style="display:none"> Gerrit-Change-Number: 13513 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>