<p>Benjamin Keith Ford would like George Joseph to <strong>review</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11550">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_messaging:  Check for body in in-dialog message<br><br>We now check that a body exists and it has a length > 0 before<br>attempting to process it.<br><br>ASTERISK-28447<br>Reported-by: Gil Richard<br><br>Change-Id: Ic469544b22ab848734636588d4c93426cc6f4b1f<br>---<br>M res/res_pjsip_messaging.c<br>1 file changed, 7 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/50/11550/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c</span><br><span>index cbc6ea5..cb3b16e 100644</span><br><span>--- a/res/res_pjsip_messaging.c</span><br><span>+++ b/res/res_pjsip_messaging.c</span><br><span>@@ -90,9 +90,13 @@</span><br><span>   int res = PJSIP_SC_UNSUPPORTED_MEDIA_TYPE;</span><br><span>   pj_str_t text = { "text", 4};</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-     /* We'll accept any text/ content type */</span><br><span style="color: hsl(0, 100%, 40%);">-   if (rdata->msg_info.msg->body && rdata->msg_info.msg->body->len</span><br><span style="color: hsl(0, 100%, 40%);">-          && pj_stricmp(&rdata->msg_info.msg->body->content_type.type, &text) == 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+  if (!(rdata->msg_info.msg->body && rdata->msg_info.msg->body->len > 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           return res;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* We'll accept any text/ or application/ content type */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (pj_stricmp(&rdata->msg_info.msg->body->content_type.type, &text) == 0</span><br><span style="color: hsl(120, 100%, 40%);">+                    || pj_stricmp(&rdata->msg_info.msg->body->content_type.type, &application) == 0) {</span><br><span>          res = PJSIP_SC_OK;</span><br><span>   } else if (rdata->msg_info.ctype</span><br><span>          && pj_stricmp(&rdata->msg_info.ctype->media.type, &text) == 0) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11550">change 11550</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/+/11550"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: certified/13.21 </div>
<div style="display:none"> Gerrit-Change-Id: Ic469544b22ab848734636588d4c93426cc6f4b1f </div>
<div style="display:none"> Gerrit-Change-Number: 11550 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>