diff options
Diffstat (limited to 'third-party/pjproject')
-rw-r--r-- | third-party/pjproject/patches/0014-Add-pjsip-transport-register-type-ipv6.patch | 62 | ||||
-rw-r--r-- | third-party/pjproject/patches/0025-fix-print-xml-crash.patch | 24 |
2 files changed, 86 insertions, 0 deletions
diff --git a/third-party/pjproject/patches/0014-Add-pjsip-transport-register-type-ipv6.patch b/third-party/pjproject/patches/0014-Add-pjsip-transport-register-type-ipv6.patch new file mode 100644 index 000000000..796473a3c --- /dev/null +++ b/third-party/pjproject/patches/0014-Add-pjsip-transport-register-type-ipv6.patch @@ -0,0 +1,62 @@ +From daeb0956524606b597704a90b54d81340e10b3e4 Mon Sep 17 00:00:00 2001 +From: Joshua Colp <jcolp@digium.com> +Date: Tue, 7 Mar 2017 12:32:49 +0000 +Subject: [PATCH] Add support for registering IPv6 transport type. + +This change allows an IPv6 transport type to be registered +and used. The IPv4 transport is found (if available) and the +IPv4 flag added to its type to match how the finding of +IPv6 transport types works. +--- + pjsip/src/pjsip/sip_transport.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c +index 7df6138..ce72814 100644 +--- a/pjsip/src/pjsip/sip_transport.c ++++ b/pjsip/src/pjsip/sip_transport.c +@@ -236,6 +236,7 @@ PJ_DEF(pj_status_t) pjsip_transport_register_type( unsigned tp_flag, + int *p_tp_type) + { + unsigned i; ++ pjsip_transport_type_e parent = 0; + + PJ_ASSERT_RETURN(tp_flag && tp_name && def_port, PJ_EINVAL); + PJ_ASSERT_RETURN(pj_ansi_strlen(tp_name) < +@@ -243,6 +244,11 @@ PJ_DEF(pj_status_t) pjsip_transport_register_type( unsigned tp_flag, + PJ_ENAMETOOLONG); + + for (i=1; i<PJ_ARRAY_SIZE(transport_names); ++i) { ++ if (tp_flag & PJSIP_TRANSPORT_IPV6 && ++ pj_stricmp2(&transport_names[i].name, tp_name) == 0) ++ { ++ parent = transport_names[i].type; ++ } + if (transport_names[i].type == 0) + break; + } +@@ -250,14 +256,19 @@ PJ_DEF(pj_status_t) pjsip_transport_register_type( unsigned tp_flag, + if (i == PJ_ARRAY_SIZE(transport_names)) + return PJ_ETOOMANY; + +- transport_names[i].type = (pjsip_transport_type_e)i; ++ if (tp_flag & PJSIP_TRANSPORT_IPV6 && parent) { ++ transport_names[i].type = parent | PJSIP_TRANSPORT_IPV6; ++ } else { ++ transport_names[i].type = (pjsip_transport_type_e)i; ++ } ++ + transport_names[i].port = (pj_uint16_t)def_port; + pj_ansi_strcpy(transport_names[i].name_buf, tp_name); + transport_names[i].name = pj_str(transport_names[i].name_buf); + transport_names[i].flag = tp_flag; + + if (p_tp_type) +- *p_tp_type = i; ++ *p_tp_type = transport_names[i].type; + + return PJ_SUCCESS; + } +-- +2.7.4 + diff --git a/third-party/pjproject/patches/0025-fix-print-xml-crash.patch b/third-party/pjproject/patches/0025-fix-print-xml-crash.patch new file mode 100644 index 000000000..eafc38906 --- /dev/null +++ b/third-party/pjproject/patches/0025-fix-print-xml-crash.patch @@ -0,0 +1,24 @@ +From 1bc5ca699f523bd8e910203a3eb4dee58f366976 Mon Sep 17 00:00:00 2001 +From: Joshua Elson <joshelson@gmail.com> +Date: Mon, 20 Mar 2017 19:28:47 -0600 +Subject: [PATCH] Prevent memory corruption on xml tag write + +--- + pjlib-util/src/pjlib-util/xml.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/pjlib-util/src/pjlib-util/xml.c b/pjlib-util/src/pjlib-util/xml.c +index 296b232..b0aad26 100644 +--- a/pjlib-util/src/pjlib-util/xml.c ++++ b/pjlib-util/src/pjlib-util/xml.c +@@ -248,6 +248,7 @@ static int xml_print_node( const pj_xml_node *node, int indent, + if (node->content.slen==0 && + node->node_head.next==(pj_xml_node*)&node->node_head) + { ++ if (SIZE_LEFT() < 3) return -1; + *p++ = ' '; + *p++ = '/'; + *p++ = '>'; +-- +2.10.1 (Apple Git-78) + |