<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/22678">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">assignment_fsm: fix possible null pointer dereference<br><br>It assignment_success(), conn_get_bts() is called to get the BTS struct<br>from the connection. However, it is not checked whether the function<br>actually returned a pointer. The bts struct is used to check if it is a<br>siemens BTS using is_siemens_bts(), so lets just check before we pass on<br>the bts pointer.<br><br>Change-Id: I5b4f44113b24d4ee4d44f54eff87056b20a7158d<br>Related: CID#216933<br>---<br>M src/osmo-bsc/assignment_fsm.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/78/22678/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c</span><br><span>index e5ef1c5..88083ba 100644</span><br><span>--- a/src/osmo-bsc/assignment_fsm.c</span><br><span>+++ b/src/osmo-bsc/assignment_fsm.c</span><br><span>@@ -232,7 +232,7 @@</span><br><span>       conn->assignment.new_lchan = NULL;</span><br><span> </span><br><span>    bts = conn_get_bts(conn);</span><br><span style="color: hsl(0, 100%, 40%);">-       if (is_siemens_bts(bts) && ts_is_tch(conn->lchan->ts)) {</span><br><span style="color: hsl(120, 100%, 40%);">+        if (bts && is_siemens_bts(bts) && ts_is_tch(conn->lchan->ts)) {</span><br><span>                /* HACK: store the actual Classmark 2 LV from the subscriber and use it here! */</span><br><span>             uint8_t cm2_lv[] = { 0x02, 0x00, 0x00 };</span><br><span>             send_siemens_mrpci(conn->lchan, cm2_lv);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/22678">change 22678</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/c/osmo-bsc/+/22678"/><meta itemprop="name" content="View Change"/></div></div>

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