<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7180">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 what are used<br>both insude and outsude the PJ_TRY/PJ_CATCH block.<br><br>Partial fix for ASTERISK_27408<br><br>Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a<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/80/7180/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..a2ce57f<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 37c1388ba87535009c0ea75e500065f15f50dc91 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..0f3d075f0 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>++ 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/7180">change 7180</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/7180"/><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: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a </div>
<div style="display:none"> Gerrit-Change-Number: 7180 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>