<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-abis/+/19127">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">input/dahdi.c: Don't simply read beyond end of msgb<br><br>Let's first add two bytes to the msgb before writing.  This way we<br>would assert in case there was no tailroom.  As we just added tailroom<br>in the previous patch of this series, we are fine<br><br>Change-Id: If84b31ea9a3fc7a6c8768918efed2822d1d58427<br>Closes: OS#4644<br>---<br>M src/input/dahdi.c<br>1 file changed, 4 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/27/19127/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/input/dahdi.c b/src/input/dahdi.c</span><br><span>index a461f27..fa16e11 100644</span><br><span>--- a/src/input/dahdi.c</span><br><span>+++ b/src/input/dahdi.c</span><br><span>@@ -224,7 +224,10 @@</span><br><span>   struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1];</span><br><span>         int ret;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    ret = write(bfd->fd, msg->data, msg->len + 2);</span><br><span style="color: hsl(120, 100%, 40%);">+       /* two bytes of space for the FCS added by DAHDI in the kernel */</span><br><span style="color: hsl(120, 100%, 40%);">+     msgb_put(msg, 2);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   ret = write(bfd->fd, msg->data, msg->len);</span><br><span>  msgb_free(msg);</span><br><span>      if (ret == -1)</span><br><span>               handle_dahdi_exception(e1i_ts);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-abis/+/19127">change 19127</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/libosmo-abis/+/19127"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-abis </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If84b31ea9a3fc7a6c8768918efed2822d1d58427 </div>
<div style="display:none"> Gerrit-Change-Number: 19127 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>