<p>Emmanuel BUU has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10269">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core/briding: correct crash case when bridge relay an empty text frame<br><br>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><br>ASTERISK-28076<br>Reported by: Emmanuel BUU<br>Tested by: Emmanuel BUU<br><br>Change-Id: Ib882dd028598f13c4c233edbfdd7e54ad44a68e9<br>---<br>M main/bridge_channel.c<br>1 file changed, 4 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/69/10269/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/bridge_channel.c b/main/bridge_channel.c</span><br><span>index 1a7df87..2e53d13 100644</span><br><span>--- a/main/bridge_channel.c</span><br><span>+++ b/main/bridge_channel.c</span><br><span>@@ -2362,9 +2362,11 @@</span><br><span>    case AST_FRAME_NULL:</span><br><span>                 break;</span><br><span>       case AST_FRAME_TEXT:</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_debug(1, "Sending TEXT frame to '%s': %*.s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+          if  (fr->datalen > 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 ast_debug(1, "Sending TEXT frame to '%s': %*.s\n",</span><br><span>                         ast_channel_name(bridge_channel->chan), fr->datalen, (char *)fr->data.ptr);</span><br><span style="color: hsl(0, 100%, 40%);">-            ast_sendtext(bridge_channel->chan, fr->data.ptr);</span><br><span style="color: hsl(120, 100%, 40%);">+                       ast_sendtext(bridge_channel->chan, fr->data.ptr);</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span>            break;</span><br><span>       case AST_FRAME_TEXT_DATA:</span><br><span>            msg = (struct ast_msg_data *)fr->data.ptr;</span><br><span></span><br></pre><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: newchange </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: 1 </div>
<div style="display:none"> Gerrit-Owner: Emmanuel BUU <emmanuel.buu@ives.fr> </div>