]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_caller_id: Fix segfault when replacing rpid or pai header 59/2759/1
authorGeorge Joseph <george.joseph@fairview5.com>
Mon, 15 Feb 2016 21:37:30 +0000 (14:37 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 4 May 2016 20:15:48 +0000 (15:15 -0500)
commit3294ac1efe241256e994baeb24b6c48c9abbb20c
tree5169ec38066e08b74c43f00f6421443c2b0c18f3
parent23554d74ab38feb17cd9c47a0f5d0702cbe657b6
res_pjsip_caller_id: Fix segfault when replacing rpid or pai header

If the PJSIP_HEADER dialplan function adds a PAI or RPID header and send_rpid
or send_pai is set, res_pjsip_caller_id attemps to retrieve, parse and modify
the header added by the dialplan function.  Since the header added by the
dialplan function is generic string, there are no virtual functions to parse
the uri and we get a segfault when we try.  Since the modify, was really only
an overwrite, we now just delete the old header if it was type PJSIP_H_OTHER
and recreate it.

This raises a question for another time though:  What should happen with
duplicate headers?  Right now res_pjsip_header_funcs doesn't check for dups
so if it's session supplement is loaded after res_pjsip_caller_id's (or any
other module that adds headers), there'll be dups in the message.

ASTERISK-25337 #close

Change-Id: I5e296b52d30f106b822c0eb27c4c2b0e0f71c7fa
(cherry picked from commit 34c64707d1aa346fb0e9c7f97e375d22dedf67d9)
res/res_pjsip_caller_id.c