<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10269">View Change</a></p><p>5 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10269/2//COMMIT_MSG">Commit Message:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10269/2//COMMIT_MSG@9">Patch Set #2, Line 9:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">If a channel creates a AST_TEXT_FRAME with datalen == 0 and an invalid<br>dataptr, it causes a crash. The proposed fix is not to call sendtext<br>on such frames. It is not entirely transparent (it removes empty text<br>frames from the communication)<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is no longer correct</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10269/2/main/bridge_channel.c">File main/bridge_channel.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10269/2/main/bridge_channel.c@2366">Patch Set #2, Line 2366:</a> <code style="font-family:monospace,monospace"> ast_channel_name(bridge_channel->chan), fr->datalen, (char *)fr->data.ptr);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">undo the indention change</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10269/2/main/frame.c">File main/frame.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10269/2/main/frame.c@263">Patch Set #2, Line 263:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (!fr->datalen) {<br> /* Actually it's just an int so we can simply copy it. */<br> out->data.uint32 = fr->data.uint32;<br> return out;<br> }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This also needs fixing for the same reason when we isolate the frame data buffer.</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">if (!fr->datalen && fr->frametype != AST_FRAME_TEXT) {<br> ...<br>}</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10269/2/main/frame.c@364">Patch Set #2, Line 364:</a> <code style="font-family:monospace,monospace"> out->data.ptr = buf + sizeof(*out) + AST_FRIENDLY_OFFSET; </code></p><p style="white-space: pre-wrap; word-wrap: break-word;">red blob</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10269/2/main/frame.c@360">Patch Set #2, Line 360:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (out->datalen) {<br> out->data.ptr = buf + sizeof(*out) + AST_FRIENDLY_OFFSET;<br> memcpy(out->data.ptr, f->data.ptr, out->datalen);<br> } else if (f->frametype == AST_FRAME_TEXT) {<br> out->data.ptr = buf + sizeof(*out) + AST_FRIENDLY_OFFSET; <br> } else {<br> out->data.uint32 = f->data.uint32;<br> }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Actually you could simplify the logic:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">if (out->datalen || f->frametype == AST_FRAME_TEXT) {<br> ...<br>} else {<br> ...<br>}</pre></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10269">change 10269</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.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.asterisk.org/10269"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Ib882dd028598f13c4c233edbfdd7e54ad44a68e9 </div>
<div style="display:none"> Gerrit-Change-Number: 10269 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Emmanuel BUU <emmanuel.buu@ives.fr> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 01 Oct 2018 22:53:40 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>