<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25838">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">lchan_fsm: fix potential NULL-pointer dereference<br><br>Test case TC_lost_sdcch_during_assignment from ttcn3-bsc-test<br>causes osmo-bsc to crash due to for_conn being NULL.<br><br>Change-Id: I373855b95f8bde0ce8f9c2ae7bf95c9135d33484<br>Related: SYS#5526, OS#5255<br>---<br>M src/osmo-bsc/lchan_fsm.c<br>1 file changed, 12 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/38/25838/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c</span><br><span>index 4eb95ff..ccd8858 100644</span><br><span>--- a/src/osmo-bsc/lchan_fsm.c</span><br><span>+++ b/src/osmo-bsc/lchan_fsm.c</span><br><span>@@ -114,6 +114,18 @@</span><br><span>       case FOR_ASSIGNMENT:</span><br><span>                 LOG_LCHAN(lchan, LOGL_NOTICE, "Signalling Assignment FSM of error (%s)\n",</span><br><span>                           lchan->last_error ? : "unknown error");</span><br><span style="color: hsl(120, 100%, 40%);">+                if (!for_conn) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      LOG_LCHAN(lchan, LOGL_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+                            "lchan activation for Assignment failed, but activation request has"</span><br><span style="color: hsl(120, 100%, 40%);">+                                " no conn\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                    break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+             if (!for_conn->assignment.fi) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    LOG_LCHAN(lchan, LOGL_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+                            "lchan activation for Assignment failed, but conn has no ongoing"</span><br><span style="color: hsl(120, 100%, 40%);">+                           " assignment procedure\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                       break;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span>            _osmo_fsm_inst_dispatch(for_conn->assignment.fi, ASSIGNMENT_EV_LCHAN_ERROR, lchan,</span><br><span>                                        file, line);</span><br><span>                 return;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25838">change 25838</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/+/25838"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: 2021q1 </div>
<div style="display:none"> Gerrit-Change-Id: I373855b95f8bde0ce8f9c2ae7bf95c9135d33484 </div>
<div style="display:none"> Gerrit-Change-Number: 25838 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>