<p>Francesco Castellano has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11505">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: protection against a broken SDP to a T.38 reINVITE<br><br>The T.38 reINVITE issued by asterisk usually contains a single m-line of<br>type image.<br><br>When a broken UAS responds with an SDP with _two_ m-lines, with the<br>audio m-line that contains a disjointed codec set wrt the one of<br>Asterisk; then a segfault occurs in process_sdp().<br><br>Usually, to have a disjointed capabilities set, you need an uncommon<br>codec on the other party and preferred_codec_only=yes on the matching<br>SIP peer definition.<br><br>Change-Id: I8b02845b53344c6babe867a3f0a5231045c7ac87<br>---<br>M channels/chan_sip.c<br>1 file changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/05/11505/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_sip.c b/channels/chan_sip.c</span><br><span>index 7c8928d..7ccf3fd 100644</span><br><span>--- a/channels/chan_sip.c</span><br><span>+++ b/channels/chan_sip.c</span><br><span>@@ -10911,7 +10911,9 @@</span><br><span> ast_rtp_lookup_mime_multiple2(s3, NULL, newnoncodeccapability, 0, 0));</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (portno != -1 || vportno != -1 || tportno != -1) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Check again for non-empty newjointcapability as there are unfortunate cases</span><br><span style="color: hsl(120, 100%, 40%);">+ * when portno is != -1, but newjointcapabilities are empty */</span><br><span style="color: hsl(120, 100%, 40%);">+ if ((portno != -1 || vportno != -1 || tportno != -1) && ast_format_cap_count(newjointcapability)) {</span><br><span> /* We are now ready to change the sip session and RTP structures with the offered codecs, since</span><br><span> they are acceptable */</span><br><span> unsigned int framing;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11505">change 11505</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/c/asterisk/+/11505"/><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-Change-Id: I8b02845b53344c6babe867a3f0a5231045c7ac87 </div>
<div style="display:none"> Gerrit-Change-Number: 11505 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Francesco Castellano <francesco.castellano@messagenet.it> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>