<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24540">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">VTY: fix NULL-pointer dereference in lchan_act_single()<br><br>Without this guard, a command like this can crash osmo-bsc:<br><br>  OsmoBSC# bts 0 trx 0 timeslot 0 sub-slot 0 activate fr<br><br>when timeslot 0 is configured as non-combined 'CCCH'.<br><br>Change-Id: I0197a6a2595ff9dade58e37383d44d2df3b03288<br>CLoses: OS#5170<br>---<br>M src/osmo-bsc/bsc_vty.c<br>1 file changed, 4 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/40/24540/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c</span><br><span>index 6f4e2ec..89aacf2 100644</span><br><span>--- a/src/osmo-bsc/bsc_vty.c</span><br><span>+++ b/src/osmo-bsc/bsc_vty.c</span><br><span>@@ -6060,6 +6060,10 @@</span><br><span>        if (activate) {</span><br><span>              LOG_LCHAN(lchan, LOGL_NOTICE, "attempt from VTY to activate lchan %s with codec %s\n",</span><br><span>                       gsm_lchan_name(lchan), codec_str);</span><br><span style="color: hsl(120, 100%, 40%);">+          if (!lchan->fi) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  vty_out(vty, "%% Cannot activate: Channel not initialized%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+                 return CMD_WARNING;</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span> </span><br><span>                int lchan_t;</span><br><span>                 if (lchan->fi->state != LCHAN_ST_UNUSED) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24540">change 24540</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/+/24540"/><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: I0197a6a2595ff9dade58e37383d44d2df3b03288 </div>
<div style="display:none"> Gerrit-Change-Number: 24540 </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>