<p>Kevin Harwell <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11560">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, approved; Approved for Submit
</div><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, 6 insertions(+), 3 deletions(-)<br><br></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 0e10a8f..930cf84 100644</span><br><span>--- a/res/res_pjsip_messaging.c</span><br><span>+++ b/res/res_pjsip_messaging.c</span><br><span>@@ -90,10 +90,13 @@</span><br><span> static const pj_str_t text = { "text", 4};</span><br><span> static const pj_str_t application = { "application", 11};</span><br><span> </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> /* We'll accept any text/ or application/ 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(0, 100%, 40%);">- || pj_stricmp(&rdata->msg_info.msg->body->content_type.type, &application) == 0)) {</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/+/11560">change 11560</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/+/11560"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: certified/16.3 </div>
<div style="display:none"> Gerrit-Change-Id: Ic469544b22ab848734636588d4c93426cc6f4b1f </div>
<div style="display:none"> Gerrit-Change-Number: 11560 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>