[Asterisk-code-review] res pjsip caller id: Use static pj str t for fromto header n... (asterisk[16])
Corey Farrell
asteriskteam at digium.com
Thu Nov 15 14:48:31 CST 2018
Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/10653
Change subject: res_pjsip_caller_id: Use static pj_str_t for fromto header names.
......................................................................
res_pjsip_caller_id: Use static pj_str_t for fromto header names.
PJSIP assumes that these header names are not allocated, does not clone
the name strings when reusing headers.
Block unload of res_pjsip_caller_id until shutdown to ensure static
memory stays valid. It was previously unsafe to unload while any
sessions are active.
Change-Id: I190854dea943d6e441cf03733f8a0da661aea27f
---
M res/res_pjsip_caller_id.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/53/10653/1
diff --git a/res/res_pjsip_caller_id.c b/res/res_pjsip_caller_id.c
index 1a5fa3c..20c73da 100644
--- a/res/res_pjsip_caller_id.c
+++ b/res/res_pjsip_caller_id.c
@@ -430,8 +430,7 @@
id_hdr = pjsip_from_hdr_create(tdata->pool);
id_hdr->type = PJSIP_H_OTHER;
- pj_strdup(tdata->pool, &id_hdr->name, hdr_name);
- id_hdr->sname = id_hdr->name;
+ id_hdr->sname = id_hdr->name = *hdr_name;
id_name_addr = pjsip_uri_clone(tdata->pool, base->uri);
id_uri = pjsip_uri_get_uri(id_name_addr->uri);
@@ -779,6 +778,7 @@
static int load_module(void)
{
+ ast_module_shutdown_ref(AST_MODULE_SELF);
ast_sip_session_register_supplement(&caller_id_supplement);
return AST_MODULE_LOAD_SUCCESS;
}
--
To view, visit https://gerrit.asterisk.org/10653
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: newchange
Gerrit-Change-Id: I190854dea943d6e441cf03733f8a0da661aea27f
Gerrit-Change-Number: 10653
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181115/a320d322/attachment.html>
More information about the asterisk-code-review
mailing list