[Asterisk-code-review] bundled pjproject: sip parser: Fix return code in pjsip fin... (asterisk[certified/13.18])

George Joseph asteriskteam at digium.com
Wed Nov 15 10:46:43 CST 2017


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/7226 )

Change subject: bundled_pjproject: sip_parser:  Fix return code in pjsip_find_msg
......................................................................

bundled_pjproject: sip_parser:  Fix return code in pjsip_find_msg

The default return code for pjsip_find_msg was PJ_SUCCESS so if
a Content-Length header wasn't found at all, pjsip_find_msg was
returning PJ_SUCCESS instead of PJSIP_EMISSINGHDR.

Also added the volatile keyword to a few variables that are used
both inside and outside the PJ_TRY/PJ_CATCH block.

Partial fix for ASTERISK_27408

Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a
(cherry picked from commit b5f2779a23aa6042893c2bdf6bebfcc5150b5300)
---
A third-party/pjproject/patches/0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch
1 file changed, 41 insertions(+), 0 deletions(-)

Approvals:
  Jenkins2: Verified
  George Joseph: Looks good to me, approved; Approved for Submit



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
new file mode 100644
index 0000000..86d5aa7
--- /dev/null
+++ b/third-party/pjproject/patches/0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch
@@ -0,0 +1,41 @@
+From 186f82627c40d0c3a56a6a94ce55c055ad1f7620 Mon Sep 17 00:00:00 2001
+From: George Joseph <gjoseph at digium.com>
+Date: Fri, 10 Nov 2017 09:26:29 -0700
+Subject: [PATCH] sip_parser: Fix return code in pjsip_find_msg and add
+ "volatile"
+
+The default return code for pjsip_find_msg was PJ_SUCCESS so if
+a Content-Length header wasn't found at all, pjsip_find_msg was
+returning PJ_SUCCESS instead of PJSIP_EMISSINGHDR.
+
+Also added the volatile keyword to a few variables what are used
+both insude and outsude the PJ_TRY/PJ_CATCH block.
+---
+ pjsip/src/pjsip/sip_parser.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c
+index f9a0e65b5..f65ffca5a 100644
+--- a/pjsip/src/pjsip/sip_parser.c
++++ b/pjsip/src/pjsip/sip_parser.c
+@@ -834,13 +834,13 @@ PJ_DEF(pj_status_t) pjsip_find_msg( const char *buf, pj_size_t size,
+ 				  pj_bool_t is_datagram, pj_size_t *msg_size)
+ {
+ #if PJ_HAS_TCP
+-    const char *hdr_end;
+-    const char *body_start;
++    const char *volatile hdr_end;
++    const char *volatile body_start;
+     const char *pos;
+-    const char *line;
++    const char *volatile line;
+     int content_length = -1;
+     pj_str_t cur_msg;
+-    pj_status_t status = PJ_SUCCESS;
++    volatile pj_status_t status = PJSIP_EMISSINGHDR;
+     const pj_str_t end_hdr = { "\n\r\n", 3};
+ 
+     *msg_size = size;
+-- 
+2.13.6
+

-- 
To view, visit https://gerrit.asterisk.org/7226
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: certified/13.18
Gerrit-MessageType: merged
Gerrit-Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a
Gerrit-Change-Number: 7226
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171115/82e72888/attachment.html>


More information about the asterisk-code-review mailing list