diff options
author | Mark Michelson <mmichelson@digium.com> | 2015-08-12 13:08:02 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-08-12 13:08:02 -0500 |
commit | cf45868984cde4d4664774b4dcddb4abb9638749 (patch) | |
tree | 07a8758df06b1ed9aca52edade4295e2aa298862 | |
parent | a87e2dd2549f1da3a81913f3209113dcfc61b20c (diff) | |
parent | f3f5b45d5792aadb555eabbe6ca1f1924b22bbe5 (diff) |
Merge "res_pjsip.c: Fix crash from corrupt saved SUBSCRIBE message."
-rw-r--r-- | res/res_pjsip.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 25a35c0c8..04e16c415 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -2645,6 +2645,12 @@ int ast_sip_create_rdata(pjsip_rx_data *rdata, char *packet, const char *src_nam { pj_str_t tmp; + /* + * Initialize the error list in case there is a parse error + * in the given packet. + */ + pj_list_init(&rdata->msg_info.parse_err); + rdata->tp_info.transport = PJ_POOL_ZALLOC_T(rdata->tp_info.pool, pjsip_transport); if (!rdata->tp_info.transport) { return -1; @@ -2655,7 +2661,7 @@ int ast_sip_create_rdata(pjsip_rx_data *rdata, char *packet, const char *src_nam rdata->pkt_info.src_port = src_port; pjsip_parse_rdata(packet, strlen(packet), rdata); - if (!rdata->msg_info.msg) { + if (!rdata->msg_info.msg || !pj_list_empty(&rdata->msg_info.parse_err)) { return -1; } |