<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7226">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bundled_pjproject: sip_parser:  Fix return code in pjsip_find_msg<br><br>The default return code for pjsip_find_msg was PJ_SUCCESS so if<br>a Content-Length header wasn't found at all, pjsip_find_msg was<br>returning PJ_SUCCESS instead of PJSIP_EMISSINGHDR.<br><br>Also added the volatile keyword to a few variables that are used<br>both inside and outside the PJ_TRY/PJ_CATCH block.<br><br>Partial fix for ASTERISK_27408<br><br>Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a<br>(cherry picked from commit b5f2779a23aa6042893c2bdf6bebfcc5150b5300)<br>---<br>A third-party/pjproject/patches/0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch<br>1 file changed, 41 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/26/7226/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/third-party/pjproject/patches/0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch b/third-party/pjproject/patches/0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch<br>new file mode 100644<br>index 0000000..86d5aa7<br>--- /dev/null<br>+++ b/third-party/pjproject/patches/0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch<br>@@ -0,0 +1,41 @@<br>+From 186f82627c40d0c3a56a6a94ce55c055ad1f7620 Mon Sep 17 00:00:00 2001<br>+From: George Joseph <gjoseph@digium.com><br>+Date: Fri, 10 Nov 2017 09:26:29 -0700<br>+Subject: [PATCH] sip_parser: Fix return code in pjsip_find_msg and add<br>+ "volatile"<br>+<br>+The default return code for pjsip_find_msg was PJ_SUCCESS so if<br>+a Content-Length header wasn't found at all, pjsip_find_msg was<br>+returning PJ_SUCCESS instead of PJSIP_EMISSINGHDR.<br>+<br>+Also added the volatile keyword to a few variables what are used<br>+both insude and outsude the PJ_TRY/PJ_CATCH block.<br>+---<br>+ pjsip/src/pjsip/sip_parser.c | 8 ++++----<br>+ 1 file changed, 4 insertions(+), 4 deletions(-)<br>+<br>+diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c<br>+index f9a0e65b5..f65ffca5a 100644<br>+--- a/pjsip/src/pjsip/sip_parser.c<br>++++ b/pjsip/src/pjsip/sip_parser.c<br>+@@ -834,13 +834,13 @@ PJ_DEF(pj_status_t) pjsip_find_msg( const char *buf, pj_size_t size,<br>+                            pj_bool_t is_datagram, pj_size_t *msg_size)<br>+ {<br>+ #if PJ_HAS_TCP<br>+-    const char *hdr_end;<br>+-    const char *body_start;<br>++    const char *volatile hdr_end;<br>++    const char *volatile body_start;<br>+     const char *pos;<br>+-    const char *line;<br>++    const char *volatile line;<br>+     int content_length = -1;<br>+     pj_str_t cur_msg;<br>+-    pj_status_t status = PJ_SUCCESS;<br>++    volatile pj_status_t status = PJSIP_EMISSINGHDR;<br>+     const pj_str_t end_hdr = { "\n\r\n", 3};<br>+ <br>+     *msg_size = size;<br>+-- <br>+2.13.6<br>+<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7226">change 7226</a>. To unsubscribe, 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/7226"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: certified/13.18 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a </div>
<div style="display:none"> Gerrit-Change-Number: 7226 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>