mirror of https://github.com/asterisk/asterisk
Removed multiple patches. Code chages in res_pjsip_pubsub due to changes in evsub. Pjsip now calls on_evsub_state() before on_rx_refresh(), so the sub tree deletion that used to take place in on_evsub_state() now must take place in on_rx_refresh(). Additionally, pjsip now requires that you send the NOTIFY from within on_rx_refresh(), otherwise it will assert when going to send the 200 OK. The idea is that it will look for this NOTIFY and cache it until after sending the response in order to deal with the self-imposed message mis-order. Asterisk previously dealt with this by pushing the NOTIFY in on_rx_refresh(), but pjsip now forces us to use it's method. Changes were required to configure in order to detect which way pjsip handles this as the two are not compatible for the reasons mentioned above. A corresponding change in testsuite is required in order to deal with the small interal timing changes caused by moving the NOTIFY send. ASTERISK-30325 Change-Id: I50b00cac89d950d3511d7b250a1c641965d9fe7fpull/31/head
parent
c85fc1278f
commit
62a64686e2
File diff suppressed because it is too large
Load Diff
@ -1,413 +0,0 @@
|
||||
commit 8e95490e37938f45d9d812905246036c3185b94f
|
||||
Author: Riza Sulistyo <trengginas@users.noreply.github.com>
|
||||
Date: Thu Mar 24 12:53:03 2022 +0700
|
||||
|
||||
Add compile time option to allow multiple Authorization header (#3010)
|
||||
|
||||
diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h
|
||||
index dfd9ce977..ccce6ed01 100644
|
||||
--- a/pjsip/include/pjsip/sip_config.h
|
||||
+++ b/pjsip/include/pjsip/sip_config.h
|
||||
@@ -1280,6 +1280,18 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void)
|
||||
# define PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY 1
|
||||
#endif
|
||||
|
||||
+/**
|
||||
+ * Allow client to send multiple Authorization header when receiving multiple
|
||||
+ * WWW-Authenticate header fields. If this is disabled, the stack will send
|
||||
+ * Authorization header field containing credentials that match the
|
||||
+ * topmost header field.
|
||||
+ *
|
||||
+ * Default is 0
|
||||
+ */
|
||||
+#ifndef PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER
|
||||
+# define PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER 0
|
||||
+#endif
|
||||
+
|
||||
/*****************************************************************************
|
||||
* SIP Event framework and presence settings.
|
||||
*/
|
||||
@@ -1458,6 +1470,11 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void)
|
||||
# define PJSIP_INV_ACCEPT_UNKNOWN_BODY PJ_FALSE
|
||||
#endif
|
||||
|
||||
+/**
|
||||
+ * Dump configuration to log with verbosity equal to info(3).
|
||||
+ */
|
||||
+PJ_DECL(void) pjsip_dump_config(void);
|
||||
+
|
||||
PJ_END_DECL
|
||||
|
||||
/**
|
||||
diff --git a/pjsip/src/pjsip/sip_auth_client.c b/pjsip/src/pjsip/sip_auth_client.c
|
||||
index 35460d01e..ab1a0cd87 100644
|
||||
--- a/pjsip/src/pjsip/sip_auth_client.c
|
||||
+++ b/pjsip/src/pjsip/sip_auth_client.c
|
||||
@@ -1367,7 +1367,7 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess,
|
||||
chal_cnt = 0;
|
||||
auth_cnt = 0;
|
||||
last_auth_err = PJSIP_EAUTHNOAUTH;
|
||||
- while (hdr != &rdata->msg_info.msg->hdr && auth_cnt == 0) {
|
||||
+ while (hdr != &rdata->msg_info.msg->hdr) {
|
||||
pjsip_cached_auth *cached_auth;
|
||||
const pjsip_www_authenticate_hdr *hchal;
|
||||
pjsip_authorization_hdr *hauth;
|
||||
@@ -1431,6 +1431,11 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess,
|
||||
/* Process next header. */
|
||||
hdr = hdr->next;
|
||||
auth_cnt++;
|
||||
+
|
||||
+#if defined(PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER) && \
|
||||
+ PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER==0
|
||||
+ break;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Check if challenge is present */
|
||||
diff --git a/pjsip/src/pjsip/sip_config.c b/pjsip/src/pjsip/sip_config.c
|
||||
index 957f9fad4..6920b3dfe 100644
|
||||
--- a/pjsip/src/pjsip/sip_config.c
|
||||
+++ b/pjsip/src/pjsip/sip_config.c
|
||||
@@ -19,6 +19,9 @@
|
||||
*/
|
||||
|
||||
#include <pjsip/sip_config.h>
|
||||
+#include <pj/log.h>
|
||||
+
|
||||
+static const char *id = "sip_config.c";
|
||||
|
||||
/* pjsip configuration instance, initialized with default values */
|
||||
pjsip_cfg_t pjsip_sip_cfg_var =
|
||||
@@ -65,6 +68,195 @@ pjsip_cfg_t pjsip_sip_cfg_var =
|
||||
}
|
||||
};
|
||||
|
||||
+PJ_DEF(void) pjsip_dump_config(void)
|
||||
+{
|
||||
+ PJ_LOG(3, (id, "Dumping PJSIP configurations:"));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_DIALOG_COUNT : %d",
|
||||
+ PJSIP_MAX_DIALOG_COUNT));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_TRANSPORTS : %d",
|
||||
+ PJSIP_MAX_TRANSPORTS));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TPMGR_HTABLE_SIZE : %d",
|
||||
+ PJSIP_TPMGR_HTABLE_SIZE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_URL_SIZE : %d",
|
||||
+ PJSIP_MAX_URL_SIZE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_MODULE : %d",
|
||||
+ PJSIP_MAX_MODULE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_PKT_LEN : %d",
|
||||
+ PJSIP_MAX_PKT_LEN));
|
||||
+ PJ_LOG(3, (id, " PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR : %d",
|
||||
+ PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR));
|
||||
+ PJ_LOG(3, (id, " PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS : %d",
|
||||
+ PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS));
|
||||
+ PJ_LOG(3, (id, " PJSIP_UDP_SIZE_THRESHOLD : %d",
|
||||
+ PJSIP_UDP_SIZE_THRESHOLD));
|
||||
+ PJ_LOG(3, (id, " PJSIP_INCLUDE_ALLOW_HDR_IN_DLG : %d",
|
||||
+ PJSIP_INCLUDE_ALLOW_HDR_IN_DLG));
|
||||
+ PJ_LOG(3, (id, " PJSIP_SAFE_MODULE : %d",
|
||||
+ PJSIP_SAFE_MODULE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_CHECK_VIA_SENT_BY : %d",
|
||||
+ PJSIP_CHECK_VIA_SENT_BY));
|
||||
+ PJ_LOG(3, (id, " PJSIP_UNESCAPE_IN_PLACE : %d",
|
||||
+ PJSIP_UNESCAPE_IN_PLACE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_NET_EVENTS : %d",
|
||||
+ PJSIP_MAX_NET_EVENTS));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_TIMED_OUT_ENTRIES : %d",
|
||||
+ PJSIP_MAX_TIMED_OUT_ENTRIES));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TRANSPORT_IDLE_TIME : %d",
|
||||
+ PJSIP_TRANSPORT_IDLE_TIME));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TRANSPORT_SERVER_IDLE_TIME : %d",
|
||||
+ PJSIP_TRANSPORT_SERVER_IDLE_TIME));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_TRANSPORT_USAGE : %d",
|
||||
+ PJSIP_MAX_TRANSPORT_USAGE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TCP_TRANSPORT_BACKLOG : %d",
|
||||
+ PJSIP_TCP_TRANSPORT_BACKLOG));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TCP_TRANSPORT_REUSEADDR : %d",
|
||||
+ PJSIP_TCP_TRANSPORT_REUSEADDR));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER : %d",
|
||||
+ PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER : %d",
|
||||
+ PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TCP_KEEP_ALIVE_INTERVAL : %d",
|
||||
+ PJSIP_TCP_KEEP_ALIVE_INTERVAL));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_INC_TRANSPORT : %d",
|
||||
+ PJSIP_POOL_INC_TRANSPORT));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_LEN_TDATA : %d",
|
||||
+ PJSIP_POOL_LEN_TDATA));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_INC_TDATA : %d",
|
||||
+ PJSIP_POOL_INC_TDATA));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_LEN_UA : %d",
|
||||
+ PJSIP_POOL_LEN_UA));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_INC_UA : %d",
|
||||
+ PJSIP_POOL_INC_UA));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_EVSUB_LEN : %d",
|
||||
+ PJSIP_POOL_EVSUB_LEN));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_EVSUB_INC : %d",
|
||||
+ PJSIP_POOL_EVSUB_INC));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_FORWARDS_VALUE : %d",
|
||||
+ PJSIP_MAX_FORWARDS_VALUE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_RFC3261_BRANCH_ID : %s",
|
||||
+ PJSIP_RFC3261_BRANCH_ID));
|
||||
+ PJ_LOG(3, (id, " PJSIP_RFC3261_BRANCH_LEN : %d",
|
||||
+ PJSIP_RFC3261_BRANCH_LEN));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_TSX_LAYER_LEN : %d",
|
||||
+ PJSIP_POOL_TSX_LAYER_LEN));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_TSX_LAYER_INC : %d",
|
||||
+ PJSIP_POOL_TSX_LAYER_INC));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_TSX_LEN : %d",
|
||||
+ PJSIP_POOL_TSX_LEN));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_TSX_INC : %d",
|
||||
+ PJSIP_POOL_TSX_INC));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TSX_1XX_RETRANS_DELAY : %d",
|
||||
+ PJSIP_TSX_1XX_RETRANS_DELAY));
|
||||
+ PJ_LOG(3, (id, " PJSIP_TSX_UAS_CONTINUE_ON_TP_ERROR : %d",
|
||||
+ PJSIP_TSX_UAS_CONTINUE_ON_TP_ERROR));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_TSX_KEY_LEN : %d",
|
||||
+ PJSIP_MAX_TSX_KEY_LEN));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_LEN_USER_AGENT : %d",
|
||||
+ PJSIP_POOL_LEN_USER_AGENT));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_INC_USER_AGENT : %d",
|
||||
+ PJSIP_POOL_INC_USER_AGENT));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_BRANCH_LEN : %d",
|
||||
+ PJSIP_MAX_HNAME_LEN));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_LEN_DIALOG : %d",
|
||||
+ PJSIP_POOL_LEN_DIALOG));
|
||||
+ PJ_LOG(3, (id, " PJSIP_POOL_INC_DIALOG : %d",
|
||||
+ PJSIP_POOL_INC_DIALOG));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_HEADER_TYPES : %d",
|
||||
+ PJSIP_MAX_HEADER_TYPES));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_URI_TYPES : %d",
|
||||
+ PJSIP_MAX_URI_TYPES));
|
||||
+ PJ_LOG(3, (id, " PJSIP_AUTH_HEADER_CACHING : %d",
|
||||
+ PJSIP_AUTH_HEADER_CACHING));
|
||||
+ PJ_LOG(3, (id, " PJSIP_AUTH_AUTO_SEND_NEXT : %d",
|
||||
+ PJSIP_AUTH_AUTO_SEND_NEXT));
|
||||
+ PJ_LOG(3, (id, " PJSIP_AUTH_QOP_SUPPORT : %d",
|
||||
+ PJSIP_AUTH_QOP_SUPPORT));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MAX_STALE_COUNT : %d",
|
||||
+ PJSIP_MAX_STALE_COUNT));
|
||||
+ PJ_LOG(3, (id, " PJSIP_HAS_DIGEST_AKA_AUTH : %d",
|
||||
+ PJSIP_HAS_DIGEST_AKA_AUTH));
|
||||
+ PJ_LOG(3, (id, " PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH : %d",
|
||||
+ PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH));
|
||||
+ PJ_LOG(3, (id, " PJSIP_REGISTER_ALLOW_EXP_REFRESH : %d",
|
||||
+ PJSIP_REGISTER_ALLOW_EXP_REFRESH));
|
||||
+ PJ_LOG(3, (id, " PJSIP_AUTH_CACHED_POOL_MAX_SIZE : %d",
|
||||
+ PJSIP_AUTH_CACHED_POOL_MAX_SIZE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY : %d",
|
||||
+ PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY));
|
||||
+ PJ_LOG(3, (id, " PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER : %d",
|
||||
+ PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER));
|
||||
+ PJ_LOG(3, (id, " PJSIP_EVSUB_TIME_UAC_REFRESH : %d",
|
||||
+ PJSIP_EVSUB_TIME_UAC_REFRESH));
|
||||
+ PJ_LOG(3, (id, " PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH : %d",
|
||||
+ PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH));
|
||||
+ PJ_LOG(3, (id, " PJSIP_EVSUB_TIME_UAC_TERMINATE : %d",
|
||||
+ PJSIP_EVSUB_TIME_UAC_TERMINATE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY : %d",
|
||||
+ PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY));
|
||||
+ PJ_LOG(3, (id, " PJSIP_PRES_DEFAULT_EXPIRES : %d",
|
||||
+ PJSIP_PRES_DEFAULT_EXPIRES));
|
||||
+ PJ_LOG(3, (id, " PJSIP_PRES_BAD_CONTENT_RESPONSE : %d",
|
||||
+ PJSIP_PRES_BAD_CONTENT_RESPONSE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_PRES_PIDF_ADD_TIMESTAMP : %d",
|
||||
+ PJSIP_PRES_PIDF_ADD_TIMESTAMP));
|
||||
+ PJ_LOG(3, (id, " PJSIP_SESS_TIMER_DEF_SE : %d",
|
||||
+ PJSIP_SESS_TIMER_DEF_SE));
|
||||
+ PJ_LOG(3, (id, " PJSIP_SESS_TIMER_RETRY_DELAY : %d",
|
||||
+ PJSIP_SESS_TIMER_RETRY_DELAY));
|
||||
+ PJ_LOG(3, (id, " PJSIP_PUBLISHC_QUEUE_REQUEST : %d",
|
||||
+ PJSIP_PUBLISHC_QUEUE_REQUEST));
|
||||
+ PJ_LOG(3, (id, " PJSIP_MWI_DEFAULT_EXPIRES : %d",
|
||||
+ PJSIP_MWI_DEFAULT_EXPIRES));
|
||||
+ PJ_LOG(3, (id, " PJSIP_HAS_TX_DATA_LIST : %d",
|
||||
+ PJSIP_HAS_TX_DATA_LIST));
|
||||
+ PJ_LOG(3, (id, " PJSIP_INV_ACCEPT_UNKNOWN_BODY : %d",
|
||||
+ PJSIP_INV_ACCEPT_UNKNOWN_BODY));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.allow_port_in_fromto_hdr : %d",
|
||||
+ pjsip_cfg()->endpt.allow_port_in_fromto_hdr));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.accept_replace_in_early_state : %d",
|
||||
+ pjsip_cfg()->endpt.accept_replace_in_early_state));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.allow_tx_hash_in_uri : %d",
|
||||
+ pjsip_cfg()->endpt.allow_tx_hash_in_uri));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.disable_rport : %d",
|
||||
+ pjsip_cfg()->endpt.disable_rport));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.disable_tcp_switch : %d",
|
||||
+ pjsip_cfg()->endpt.disable_tcp_switch));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.disable_tls_switch : %d",
|
||||
+ pjsip_cfg()->endpt.disable_tls_switch));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.follow_early_media_fork : %d",
|
||||
+ pjsip_cfg()->endpt.follow_early_media_fork));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.req_has_via_alias : %d",
|
||||
+ pjsip_cfg()->endpt.req_has_via_alias));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.resolve_hostname_to_get_interface:%d",
|
||||
+ pjsip_cfg()->endpt.resolve_hostname_to_get_interface));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.disable_secure_dlg_check : %d",
|
||||
+ pjsip_cfg()->endpt.disable_secure_dlg_check));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.use_compact_form : %d",
|
||||
+ pjsip_cfg()->endpt.use_compact_form));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.accept_multiple_sdp_answers : %d",
|
||||
+ pjsip_cfg()->endpt.accept_multiple_sdp_answers));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->endpt.keep_inv_after_tsx_timeout : %d",
|
||||
+ pjsip_cfg()->endpt.keep_inv_after_tsx_timeout));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->tsx.max_count : %d",
|
||||
+ pjsip_cfg()->tsx.max_count));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->tsx.t1 : %d",
|
||||
+ pjsip_cfg()->tsx.t1));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->tsx.t2 : %d",
|
||||
+ pjsip_cfg()->tsx.t2));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->tsx.t4 : %d",
|
||||
+ pjsip_cfg()->tsx.t4));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->td : %d",
|
||||
+ pjsip_cfg()->tsx.td));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->regc.check_contact : %d",
|
||||
+ pjsip_cfg()->regc.check_contact));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->regc.add_xuid_param : %d",
|
||||
+ pjsip_cfg()->regc.add_xuid_param));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->tcp.keep_alive_interval : %d",
|
||||
+ pjsip_cfg()->tcp.keep_alive_interval));
|
||||
+ PJ_LOG(3, (id, " pjsip_cfg()->tls.keep_alive_interval : %d",
|
||||
+ pjsip_cfg()->tls.keep_alive_interval));
|
||||
+}
|
||||
+
|
||||
|
||||
#ifdef PJ_DLL
|
||||
PJ_DEF(pjsip_cfg_t*) pjsip_cfg(void)
|
||||
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c
|
||||
index c437011b5..343316b56 100644
|
||||
--- a/pjsip/src/pjsua-lib/pjsua_core.c
|
||||
+++ b/pjsip/src/pjsua-lib/pjsua_core.c
|
||||
@@ -3443,8 +3443,10 @@ PJ_DEF(void) pjsua_dump(pj_bool_t detail)
|
||||
old_decor = pj_log_get_decor();
|
||||
pj_log_set_decor(old_decor & (PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_CR));
|
||||
|
||||
- if (detail)
|
||||
+ if (detail) {
|
||||
pj_dump_config();
|
||||
+ pjsip_dump_config();
|
||||
+ }
|
||||
|
||||
pjsip_endpt_dump(pjsua_get_pjsip_endpt(), detail);
|
||||
|
||||
diff --git a/tests/pjsua/inc_sip.py b/tests/pjsua/inc_sip.py
|
||||
index f7e64816e..2cc1a17a8 100644
|
||||
--- a/tests/pjsua/inc_sip.py
|
||||
+++ b/tests/pjsua/inc_sip.py
|
||||
@@ -306,9 +306,11 @@ class RecvfromTransaction:
|
||||
body = None
|
||||
# Pattern to be expected on pjsua when receiving the response
|
||||
expect = ""
|
||||
+ # Required config
|
||||
+ pj_config = ""
|
||||
|
||||
def __init__(self, title, resp_code, check_cseq=True,
|
||||
- include=[], exclude=[], cmds=[], resp_hdr=[], resp_body=None, expect=""):
|
||||
+ include=[], exclude=[], cmds=[], resp_hdr=[], resp_body=None, expect="", pj_config=""):
|
||||
self.title = title
|
||||
self.cmds = cmds
|
||||
self.include = include
|
||||
@@ -317,6 +319,7 @@ class RecvfromTransaction:
|
||||
self.resp_hdr = resp_hdr
|
||||
self.body = resp_body
|
||||
self.expect = expect
|
||||
+ self.pj_config=pj_config
|
||||
|
||||
|
||||
class RecvfromCfg:
|
||||
@@ -328,15 +331,18 @@ class RecvfromCfg:
|
||||
transaction = None
|
||||
# Use TCP?
|
||||
tcp = False
|
||||
+ # Required config
|
||||
+ pj_config = ""
|
||||
|
||||
# Note:
|
||||
# Any "$PORT" string in the pjsua_args will be replaced
|
||||
# by server port
|
||||
- def __init__(self, name, pjsua_args, transaction, tcp=False):
|
||||
+ def __init__(self, name, pjsua_args, transaction, tcp=False, pj_config=""):
|
||||
self.name = name
|
||||
self.inst_param = cfg.InstanceParam("pjsua", pjsua_args)
|
||||
self.transaction = transaction
|
||||
self.tcp=tcp
|
||||
+ self.pj_config=pj_config
|
||||
|
||||
|
||||
|
||||
diff --git a/tests/pjsua/mod_recvfrom.py b/tests/pjsua/mod_recvfrom.py
|
||||
index 918006aff..4305bfb42 100644
|
||||
--- a/tests/pjsua/mod_recvfrom.py
|
||||
+++ b/tests/pjsua/mod_recvfrom.py
|
||||
@@ -18,10 +18,20 @@ def test_func(test):
|
||||
local_port=srv_port,
|
||||
tcp=cfg_file.recvfrom_cfg.tcp)
|
||||
|
||||
+ config = pjsua.get_config(cfg_file.recvfrom_cfg.pj_config)
|
||||
+ print "Config : " + config
|
||||
+
|
||||
last_cseq = 0
|
||||
last_method = ""
|
||||
last_call_id = ""
|
||||
for t in cfg_file.recvfrom_cfg.transaction:
|
||||
+ # Check if transaction requires configuration
|
||||
+ if t.pj_config != "":
|
||||
+ r = re.compile(t.pj_config, re.I)
|
||||
+ if r.search(config) == None:
|
||||
+ print "Configuration : " + t.pj_config + " not found, skipping"
|
||||
+ continue
|
||||
+
|
||||
# Print transaction title
|
||||
if t.title != "":
|
||||
dlg.trace(t.title)
|
||||
diff --git a/tests/pjsua/run.py b/tests/pjsua/run.py
|
||||
index 35b00dec5..cffc38470 100644
|
||||
--- a/tests/pjsua/run.py
|
||||
+++ b/tests/pjsua/run.py
|
||||
@@ -249,6 +249,10 @@ class Expect(threading.Thread):
|
||||
time.sleep(0.01)
|
||||
return None
|
||||
|
||||
+ def get_config(self, key_config):
|
||||
+ self.send("dd")
|
||||
+ line = self.expect(key_config);
|
||||
+ return line
|
||||
|
||||
def sync_stdout(self):
|
||||
if not self.use_telnet:
|
||||
diff --git a/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py b/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py
|
||||
index a98b8b1d8..909ba229b 100644
|
||||
--- a/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py
|
||||
+++ b/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py
|
||||
@@ -14,16 +14,27 @@ req1 = sip.RecvfromTransaction("Initial registration", 401,
|
||||
expect="SIP/2.0 401"
|
||||
)
|
||||
|
||||
-req2 = sip.RecvfromTransaction("Registration retry with auth", 200,
|
||||
+req2 = sip.RecvfromTransaction("Registration retry with auth (not allowed multiple auth)", 200,
|
||||
include=["REGISTER sip",
|
||||
- # Must only have 1 Auth hdr since #2887
|
||||
"Authorization:", # [\\s\\S]+Authorization:"
|
||||
"realm=\"python1\"", # "realm=\"python2\"",
|
||||
"username=\"theuser1\"", # "username=\"theuser2\"",
|
||||
"nonce=\"1234\"", # "nonce=\"6789\"",
|
||||
"response="],
|
||||
- expect="registration success"
|
||||
+ expect="registration success",
|
||||
+ pj_config="PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER.*: 0"
|
||||
)
|
||||
|
||||
+req3 = sip.RecvfromTransaction("Registration retry with auth (allowed multiple auth)", 200,
|
||||
+ include=["REGISTER sip",
|
||||
+ "Authorization:[\\s\\S]+Authorization:", # Must have 2 Auth hdrs
|
||||
+ "realm=\"python1\"", "realm=\"python2\"",
|
||||
+ "username=\"theuser1\"", "username=\"theuser2\"",
|
||||
+ "nonce=\"1234\"", "nonce=\"6789\"",
|
||||
+ "response="],
|
||||
+ expect="registration success",
|
||||
+ pj_config="PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER.*: 1"
|
||||
+ )
|
||||
+
|
||||
recvfrom_cfg = sip.RecvfromCfg("Multiple authentication challenges",
|
||||
- pjsua, [req1, req2])
|
||||
+ pjsua, [req1, req2, req3], pj_config="PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER")
|
@ -1,306 +0,0 @@
|
||||
From c4d34984ec92b3d5252a7d5cddd85a1d3a8001ae Mon Sep 17 00:00:00 2001
|
||||
From: sauwming <ming@teluu.com>
|
||||
Date: Mon, 3 Oct 2022 08:07:22 +0800
|
||||
Subject: [PATCH] Merge pull request from GHSA-fq45-m3f7-3mhj
|
||||
|
||||
* Initial patch
|
||||
|
||||
* Use 'pj_scan_is_eof(scanner)'
|
||||
|
||||
Co-authored-by: Aaron Lichtman <aaronlichtman@gmail.com>
|
||||
|
||||
* Use 'pj_scan_is_eof(scanner)'
|
||||
|
||||
Co-authored-by: Aaron Lichtman <aaronlichtman@gmail.com>
|
||||
|
||||
* Use 'pj_scan_is_eof(scanner)'
|
||||
|
||||
Co-authored-by: Aaron Lichtman <aaronlichtman@gmail.com>
|
||||
|
||||
* Use `!pj_scan_is_eof` instead of manually checking `scanner->curptr < scanner->end`
|
||||
|
||||
Co-authored-by: Maksim Mukosey <mmukosey@gmail.com>
|
||||
|
||||
* Update pjlib-util/src/pjlib-util/scanner.c
|
||||
|
||||
Co-authored-by: Aaron Lichtman <aaronlichtman@gmail.com>
|
||||
|
||||
* Update pjlib-util/src/pjlib-util/scanner.c
|
||||
|
||||
Co-authored-by: Aaron Lichtman <aaronlichtman@gmail.com>
|
||||
|
||||
* Update pjlib-util/src/pjlib-util/scanner.c
|
||||
|
||||
Co-authored-by: Aaron Lichtman <aaronlichtman@gmail.com>
|
||||
|
||||
* Revert '>=' back to '>' in pj_scan_stricmp_alnum()
|
||||
|
||||
* Fix error compiles.
|
||||
|
||||
Co-authored-by: Nanang Izzuddin <nanang@teluu.com>
|
||||
Co-authored-by: Aaron Lichtman <aaronlichtman@gmail.com>
|
||||
Co-authored-by: Maksim Mukosey <mmukosey@gmail.com>
|
||||
---
|
||||
pjlib-util/src/pjlib-util/scanner.c | 41 +++++++++++++++++++----------
|
||||
pjmedia/src/pjmedia/rtp.c | 11 +++++---
|
||||
pjmedia/src/pjmedia/sdp.c | 24 ++++++++++-------
|
||||
3 files changed, 48 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/pjlib-util/src/pjlib-util/scanner.c b/pjlib-util/src/pjlib-util/scanner.c
|
||||
index a54edf2d8..6541bbae3 100644
|
||||
--- a/pjlib-util/src/pjlib-util/scanner.c
|
||||
+++ b/pjlib-util/src/pjlib-util/scanner.c
|
||||
@@ -195,7 +195,13 @@ PJ_DEF(void) pj_scan_skip_whitespace( pj_scanner *scanner )
|
||||
|
||||
PJ_DEF(void) pj_scan_skip_line( pj_scanner *scanner )
|
||||
{
|
||||
- char *s = pj_memchr(scanner->curptr, '\n', scanner->end - scanner->curptr);
|
||||
+ char *s;
|
||||
+
|
||||
+ if (pj_scan_is_eof(scanner)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ s = pj_memchr(scanner->curptr, '\n', scanner->end - scanner->curptr);
|
||||
if (!s) {
|
||||
scanner->curptr = scanner->end;
|
||||
} else {
|
||||
@@ -264,8 +270,7 @@ PJ_DEF(void) pj_scan_get( pj_scanner *scanner,
|
||||
|
||||
pj_assert(pj_cis_match(spec,0)==0);
|
||||
|
||||
- /* EOF is detected implicitly */
|
||||
- if (!pj_cis_match(spec, *s)) {
|
||||
+ if (pj_scan_is_eof(scanner) || !pj_cis_match(spec, *s)) {
|
||||
pj_scan_syntax_err(scanner);
|
||||
return;
|
||||
}
|
||||
@@ -299,8 +304,7 @@ PJ_DEF(void) pj_scan_get_unescape( pj_scanner *scanner,
|
||||
/* Must not match character '%' */
|
||||
pj_assert(pj_cis_match(spec,'%')==0);
|
||||
|
||||
- /* EOF is detected implicitly */
|
||||
- if (!pj_cis_match(spec, *s) && *s != '%') {
|
||||
+ if (pj_scan_is_eof(scanner) || !pj_cis_match(spec, *s) && *s != '%') {
|
||||
pj_scan_syntax_err(scanner);
|
||||
return;
|
||||
}
|
||||
@@ -436,7 +440,9 @@ PJ_DEF(void) pj_scan_get_n( pj_scanner *scanner,
|
||||
|
||||
scanner->curptr += N;
|
||||
|
||||
- if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) {
|
||||
+ if (!pj_scan_is_eof(scanner) &&
|
||||
+ PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws)
|
||||
+ {
|
||||
pj_scan_skip_whitespace(scanner);
|
||||
}
|
||||
}
|
||||
@@ -467,15 +473,16 @@ PJ_DEF(int) pj_scan_get_char( pj_scanner *scanner )
|
||||
|
||||
PJ_DEF(void) pj_scan_get_newline( pj_scanner *scanner )
|
||||
{
|
||||
- if (!PJ_SCAN_IS_NEWLINE(*scanner->curptr)) {
|
||||
+ if (pj_scan_is_eof(scanner) || !PJ_SCAN_IS_NEWLINE(*scanner->curptr)) {
|
||||
pj_scan_syntax_err(scanner);
|
||||
return;
|
||||
}
|
||||
|
||||
+ /* We have checked scanner->curptr validity above */
|
||||
if (*scanner->curptr == '\r') {
|
||||
++scanner->curptr;
|
||||
}
|
||||
- if (*scanner->curptr == '\n') {
|
||||
+ if (!pj_scan_is_eof(scanner) && *scanner->curptr == '\n') {
|
||||
++scanner->curptr;
|
||||
}
|
||||
|
||||
@@ -520,7 +527,9 @@ PJ_DEF(void) pj_scan_get_until( pj_scanner *scanner,
|
||||
|
||||
scanner->curptr = s;
|
||||
|
||||
- if (PJ_SCAN_IS_PROBABLY_SPACE(*s) && scanner->skip_ws) {
|
||||
+ if (!pj_scan_is_eof(scanner) && PJ_SCAN_IS_PROBABLY_SPACE(*s) &&
|
||||
+ scanner->skip_ws)
|
||||
+ {
|
||||
pj_scan_skip_whitespace(scanner);
|
||||
}
|
||||
}
|
||||
@@ -544,7 +553,9 @@ PJ_DEF(void) pj_scan_get_until_ch( pj_scanner *scanner,
|
||||
|
||||
scanner->curptr = s;
|
||||
|
||||
- if (PJ_SCAN_IS_PROBABLY_SPACE(*s) && scanner->skip_ws) {
|
||||
+ if (!pj_scan_is_eof(scanner) && PJ_SCAN_IS_PROBABLY_SPACE(*s) &&
|
||||
+ scanner->skip_ws)
|
||||
+ {
|
||||
pj_scan_skip_whitespace(scanner);
|
||||
}
|
||||
}
|
||||
@@ -570,7 +581,9 @@ PJ_DEF(void) pj_scan_get_until_chr( pj_scanner *scanner,
|
||||
|
||||
scanner->curptr = s;
|
||||
|
||||
- if (PJ_SCAN_IS_PROBABLY_SPACE(*s) && scanner->skip_ws) {
|
||||
+ if (!pj_scan_is_eof(scanner) && PJ_SCAN_IS_PROBABLY_SPACE(*s) &&
|
||||
+ scanner->skip_ws)
|
||||
+ {
|
||||
pj_scan_skip_whitespace(scanner);
|
||||
}
|
||||
}
|
||||
@@ -585,7 +598,9 @@ PJ_DEF(void) pj_scan_advance_n( pj_scanner *scanner,
|
||||
|
||||
scanner->curptr += N;
|
||||
|
||||
- if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && skip_ws) {
|
||||
+ if (!pj_scan_is_eof(scanner) &&
|
||||
+ PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && skip_ws)
|
||||
+ {
|
||||
pj_scan_skip_whitespace(scanner);
|
||||
}
|
||||
}
|
||||
@@ -636,5 +651,3 @@ PJ_DEF(void) pj_scan_restore_state( pj_scanner *scanner,
|
||||
scanner->line = state->line;
|
||||
scanner->start_line = state->start_line;
|
||||
}
|
||||
-
|
||||
-
|
||||
diff --git a/pjmedia/src/pjmedia/rtp.c b/pjmedia/src/pjmedia/rtp.c
|
||||
index 18917f18b..d29348cc5 100644
|
||||
--- a/pjmedia/src/pjmedia/rtp.c
|
||||
+++ b/pjmedia/src/pjmedia/rtp.c
|
||||
@@ -188,6 +188,11 @@ PJ_DEF(pj_status_t) pjmedia_rtp_decode_rtp2(
|
||||
/* Payload is located right after header plus CSRC */
|
||||
offset = sizeof(pjmedia_rtp_hdr) + ((*hdr)->cc * sizeof(pj_uint32_t));
|
||||
|
||||
+ /* Check that offset is less than packet size */
|
||||
+ if (offset >= pkt_len) {
|
||||
+ return PJMEDIA_RTP_EINLEN;
|
||||
+ }
|
||||
+
|
||||
/* Decode RTP extension. */
|
||||
if ((*hdr)->x) {
|
||||
if (offset + sizeof (pjmedia_rtp_ext_hdr) > (unsigned)pkt_len)
|
||||
@@ -202,8 +207,8 @@ PJ_DEF(pj_status_t) pjmedia_rtp_decode_rtp2(
|
||||
dec_hdr->ext_len = 0;
|
||||
}
|
||||
|
||||
- /* Check that offset is less than packet size */
|
||||
- if (offset > pkt_len)
|
||||
+ /* Check again that offset is still less than packet size */
|
||||
+ if (offset >= pkt_len)
|
||||
return PJMEDIA_RTP_EINLEN;
|
||||
|
||||
/* Find and set payload. */
|
||||
@@ -393,5 +398,3 @@ void pjmedia_rtp_seq_update( pjmedia_rtp_seq_session *sess,
|
||||
seq_status->status.value = st.status.value;
|
||||
}
|
||||
}
|
||||
-
|
||||
-
|
||||
diff --git a/pjmedia/src/pjmedia/sdp.c b/pjmedia/src/pjmedia/sdp.c
|
||||
index 3905c2f52..647f49e13 100644
|
||||
--- a/pjmedia/src/pjmedia/sdp.c
|
||||
+++ b/pjmedia/src/pjmedia/sdp.c
|
||||
@@ -983,13 +983,13 @@ static void parse_version(pj_scanner *scanner,
|
||||
ctx->last_error = PJMEDIA_SDP_EINVER;
|
||||
|
||||
/* check equal sign */
|
||||
- if (*(scanner->curptr+1) != '=') {
|
||||
+ if (scanner->curptr+1 >= scanner->end || *(scanner->curptr+1) != '=') {
|
||||
on_scanner_error(scanner);
|
||||
return;
|
||||
}
|
||||
|
||||
/* check version is 0 */
|
||||
- if (*(scanner->curptr+2) != '0') {
|
||||
+ if (scanner->curptr+2 >= scanner->end || *(scanner->curptr+2) != '0') {
|
||||
on_scanner_error(scanner);
|
||||
return;
|
||||
}
|
||||
@@ -1006,7 +1006,7 @@ static void parse_origin(pj_scanner *scanner, pjmedia_sdp_session *ses,
|
||||
ctx->last_error = PJMEDIA_SDP_EINORIGIN;
|
||||
|
||||
/* check equal sign */
|
||||
- if (*(scanner->curptr+1) != '=') {
|
||||
+ if (scanner->curptr+1 >= scanner->end || *(scanner->curptr+1) != '=') {
|
||||
on_scanner_error(scanner);
|
||||
return;
|
||||
}
|
||||
@@ -1052,7 +1052,7 @@ static void parse_time(pj_scanner *scanner, pjmedia_sdp_session *ses,
|
||||
ctx->last_error = PJMEDIA_SDP_EINTIME;
|
||||
|
||||
/* check equal sign */
|
||||
- if (*(scanner->curptr+1) != '=') {
|
||||
+ if (scanner->curptr+1 >= scanner->end || *(scanner->curptr+1) != '=') {
|
||||
on_scanner_error(scanner);
|
||||
return;
|
||||
}
|
||||
@@ -1080,7 +1080,7 @@ static void parse_generic_line(pj_scanner *scanner, pj_str_t *str,
|
||||
ctx->last_error = PJMEDIA_SDP_EINSDP;
|
||||
|
||||
/* check equal sign */
|
||||
- if (*(scanner->curptr+1) != '=') {
|
||||
+ if ((scanner->curptr+1 >= scanner->end) || *(scanner->curptr+1) != '=') {
|
||||
on_scanner_error(scanner);
|
||||
return;
|
||||
}
|
||||
@@ -1149,7 +1149,7 @@ static void parse_media(pj_scanner *scanner, pjmedia_sdp_media *med,
|
||||
ctx->last_error = PJMEDIA_SDP_EINMEDIA;
|
||||
|
||||
/* check the equal sign */
|
||||
- if (*(scanner->curptr+1) != '=') {
|
||||
+ if (scanner->curptr+1 >= scanner->end || *(scanner->curptr+1) != '=') {
|
||||
on_scanner_error(scanner);
|
||||
return;
|
||||
}
|
||||
@@ -1164,6 +1164,10 @@ static void parse_media(pj_scanner *scanner, pjmedia_sdp_media *med,
|
||||
/* port */
|
||||
pj_scan_get(scanner, &cs_token, &str);
|
||||
med->desc.port = (unsigned short)pj_strtoul(&str);
|
||||
+ if (pj_scan_is_eof(scanner)) {
|
||||
+ on_scanner_error(scanner);
|
||||
+ return;
|
||||
+ }
|
||||
if (*scanner->curptr == '/') {
|
||||
/* port count */
|
||||
pj_scan_get_char(scanner);
|
||||
@@ -1175,7 +1179,7 @@ static void parse_media(pj_scanner *scanner, pjmedia_sdp_media *med,
|
||||
}
|
||||
|
||||
if (pj_scan_get_char(scanner) != ' ') {
|
||||
- PJ_THROW(SYNTAX_ERROR);
|
||||
+ on_scanner_error(scanner);
|
||||
}
|
||||
|
||||
/* transport */
|
||||
@@ -1183,7 +1187,7 @@ static void parse_media(pj_scanner *scanner, pjmedia_sdp_media *med,
|
||||
|
||||
/* format list */
|
||||
med->desc.fmt_count = 0;
|
||||
- while (*scanner->curptr == ' ') {
|
||||
+ while (scanner->curptr < scanner->end && *scanner->curptr == ' ') {
|
||||
pj_str_t fmt;
|
||||
|
||||
pj_scan_get_char(scanner);
|
||||
@@ -1223,7 +1227,7 @@ static pjmedia_sdp_attr *parse_attr( pj_pool_t *pool, pj_scanner *scanner,
|
||||
attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
|
||||
|
||||
/* check equal sign */
|
||||
- if (*(scanner->curptr+1) != '=') {
|
||||
+ if (scanner->curptr+1 >= scanner->end || *(scanner->curptr+1) != '=') {
|
||||
on_scanner_error(scanner);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1242,7 +1246,7 @@ static pjmedia_sdp_attr *parse_attr( pj_pool_t *pool, pj_scanner *scanner,
|
||||
pj_scan_get_char(scanner);
|
||||
|
||||
/* get value */
|
||||
- if (*scanner->curptr != '\r' && *scanner->curptr != '\n') {
|
||||
+ if (!pj_scan_is_eof(scanner) && *scanner->curptr != '\r' && *scanner->curptr != '\n') {
|
||||
pj_scan_get_until_chr(scanner, "\r\n", &attr->value);
|
||||
} else {
|
||||
attr->value.ptr = NULL;
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 450baca94f475345542c6953832650c390889202 Mon Sep 17 00:00:00 2001
|
||||
From: sauwming <ming@teluu.com>
|
||||
Date: Tue, 7 Jun 2022 12:00:13 +0800
|
||||
Subject: [PATCH] Merge pull request from GHSA-26j7-ww69-c4qj
|
||||
|
||||
---
|
||||
pjlib-util/src/pjlib-util/stun_simple.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/pjlib-util/src/pjlib-util/stun_simple.c b/pjlib-util/src/pjlib-util/stun_simple.c
|
||||
index 722519584..d0549176d 100644
|
||||
--- a/pjlib-util/src/pjlib-util/stun_simple.c
|
||||
+++ b/pjlib-util/src/pjlib-util/stun_simple.c
|
||||
@@ -54,6 +54,7 @@ PJ_DEF(pj_status_t) pjstun_parse_msg( void *buf, pj_size_t buf_len,
|
||||
{
|
||||
pj_uint16_t msg_type, msg_len;
|
||||
char *p_attr;
|
||||
+ int attr_max_cnt = PJ_ARRAY_SIZE(msg->attr);
|
||||
|
||||
PJ_CHECK_STACK();
|
||||
|
||||
@@ -83,7 +84,7 @@ PJ_DEF(pj_status_t) pjstun_parse_msg( void *buf, pj_size_t buf_len,
|
||||
msg->attr_count = 0;
|
||||
p_attr = (char*)buf + sizeof(pjstun_msg_hdr);
|
||||
|
||||
- while (msg_len > 0) {
|
||||
+ while (msg_len > 0 && msg->attr_count < attr_max_cnt) {
|
||||
pjstun_attr_hdr **attr = &msg->attr[msg->attr_count];
|
||||
pj_uint32_t len;
|
||||
pj_uint16_t attr_type;
|
||||
@@ -111,6 +112,10 @@ PJ_DEF(pj_status_t) pjstun_parse_msg( void *buf, pj_size_t buf_len,
|
||||
p_attr += len;
|
||||
++msg->attr_count;
|
||||
}
|
||||
+ if (msg->attr_count == attr_max_cnt) {
|
||||
+ PJ_LOG(4, (THIS_FILE, "Warning: max number attribute %d reached.",
|
||||
+ attr_max_cnt));
|
||||
+ }
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1 +0,0 @@
|
||||
7f80ba8e1540853f959be6be7912a150 pjproject-2.12.1.tar.bz2
|
@ -0,0 +1 @@
|
||||
221bc1d38106b879fdbcf6ca9389b80b pjproject-2.13.tar.bz2
|
@ -1,2 +1,2 @@
|
||||
JANSSON_VERSION = 2.14
|
||||
PJPROJECT_VERSION = 2.12.1
|
||||
PJPROJECT_VERSION = 2.13
|
||||
|
Loading…
Reference in new issue