res_pjsip: Validate that contact uris start with sip: or sips:
authorGeorge Joseph <george.joseph@fairview5.com>
Thu, 23 Apr 2015 14:16:45 +0000 (08:16 -0600)
committerGeorge Joseph <george.joseph@fairview5.com>
Thu, 23 Apr 2015 16:54:59 +0000 (11:54 -0500)
commit75666ad7c608ad9968a216a8f0a5832bf85b785c
treef5ecab6ffd5ecc84e40e0809c1ef0e37031ddffd
parent7ccaf8aa46ae98be8289180d6b68c17f177e4f2f
res_pjsip:  Validate that contact uris start with sip: or sips:

Currently we use pjsip_parse_hdr to validate contact uris but it
appears that it allows uris without a scheme if there's a port
supplied.  I.E myexample.com will fail but myexample.com:5060 will
pass even though it has no scheme.  This causes SEGVs later on
whenever the uri is used.

To prevent this, permanent_contact_validate has been updated to check
that the scheme is either 'sip' or 'sips'.

2 uses of possibly-null endpoint have also been fixed in
create_out_of_dialog_request.

ASTERISK-24999

Change-Id: Ifc17d16a4923e1045d37fe51e43bbe29fa556ca2
Reported-by: Brad Latus
res/res_pjsip.c
res/res_pjsip/location.c