<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/19962">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">SI Type 4: prevent potential buffer overflow<br><br>Make sure that in generate_si4() we do not corrupt other SI buffers<br>by limiting maximum length of the Mobile Allocation to 2 octets.<br>This would preserve at least 2 octets for the Rest Octets, what<br>should be enough to encode at least GPRS Indicator.<br><br>Change-Id: I2e3553865096faecda6bb22fc25b83fd47b738c4<br>Related: SYS#4868, OS#4545<br>---<br>M src/osmo-bsc/system_information.c<br>1 file changed, 3 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/62/19962/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c</span><br><span>index 2418e32..b969989 100644</span><br><span>--- a/src/osmo-bsc/system_information.c</span><br><span>+++ b/src/osmo-bsc/system_information.c</span><br><span>@@ -974,6 +974,9 @@</span><br><span> </span><br><span>             /* 10.5.2.21 (TLV) CBCH Mobile Allocation IE */</span><br><span>              if (ts->hopping.enabled) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 /* Prevent potential buffer overflow */</span><br><span style="color: hsl(120, 100%, 40%);">+                       if (ts->hopping.ma_len > 2)</span><br><span style="color: hsl(120, 100%, 40%);">+                             return -ENOMEM;</span><br><span>                      tail = tlv_put(tail, GSM48_IE_CBCH_MOB_AL,</span><br><span>                                  ts->hopping.ma_len,</span><br><span>                                       ts->hopping.ma_data);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/19962">change 19962</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/+/19962"/><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: I2e3553865096faecda6bb22fc25b83fd47b738c4 </div>
<div style="display:none"> Gerrit-Change-Number: 19962 </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>