summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-04-21 14:02:09 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-04-21 14:02:09 -0500
commit57c908c7a59056f6ea66ebe1453f2454be837233 (patch)
tree5ca5057978de2b4cc92078dacea5bf2da86d66e1
parent24913e154099aa1a47772aab1193a3751ad55fca (diff)
parent70e860ec4905050c4cba5b6f8f5a7f710a96627b (diff)
Merge "res_pjsip_callerid: Clear out display name if id->name is not valid"
-rw-r--r--res/res_pjsip_caller_id.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/res/res_pjsip_caller_id.c b/res/res_pjsip_caller_id.c
index 1818105d7..283ec94e5 100644
--- a/res/res_pjsip_caller_id.c
+++ b/res/res_pjsip_caller_id.c
@@ -424,6 +424,12 @@ static pjsip_fromto_hdr *create_new_id_hdr(const pj_str_t *hdr_name, pjsip_fromt
ast_escape_quoted(id->name.str, name_buf, name_buf_len);
pj_strdup2(tdata->pool, &id_name_addr->display, name_buf);
+ } else {
+ /*
+ * We need to clear the remnants of the clone or it'll be left set.
+ * pj_strdup2 is safe to call with a NULL src and it resets both slen and ptr.
+ */
+ pj_strdup2(tdata->pool, &id_name_addr->display, NULL);
}
pj_strdup2(tdata->pool, &id_uri->user, id->number.str);