]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_refer.c: Fix seg fault in process of Refer-to header. 60/2360/3
authorSergio Medina Toledo <lumasepa@gmail.com>
Thu, 3 Mar 2016 10:43:59 +0000 (10:43 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 17 Mar 2016 18:12:29 +0000 (13:12 -0500)
commit2b1b8e382a46fccd12bd60145cee2ffcf69663a6
treefcdee8f09e7f8a309a1b343380ff30323f8ebf12
parentaeef52db9fdd8b48ba294f573580525e8bb96471
res_pjsip_refer.c: Fix seg fault in process of Refer-to header.

The "Refer-to" header of an incoming REFER request is parsed by
pjsip_parse_uri().  That function requires the URI parameter to be NULL
terminated.  Unfortunately, the previous code added the NULL terminator by
overwriting memory that may not be safe.  The overwritten memory results
could be benign, memory corruption, or a segmentation fault.  Now the URI
is NULL terminated safely by copying the URI to a new chunk of memory with
the correct size to be NULL terminated.

ASTERISK-25814 #close

Change-Id: I32565496684a5a49c3278fce06474b8c94b37342
res/res_pjsip_refer.c