]> git.ipfire.org Git - thirdparty/asterisk.git/commit
PJSIP: Remove PJSIP parsing functions from uri length validation. 44/2644/3
authorMark Michelson <mmichelson@digium.com>
Mon, 18 Apr 2016 17:12:37 +0000 (12:12 -0500)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 19 Apr 2016 15:47:18 +0000 (10:47 -0500)
commit0235a6653262fa3bebdaf1f89aac5e570442da5c
tree8d7eba962dffc6f63212281f1b358c5154fb8f61
parent64b03ec7029d6d313f7ebdb12603f11fa4df501d
PJSIP: Remove PJSIP parsing functions from uri length validation.

The PJSIP parsing functions provide a nice concise way to check the
length of a hostname in a SIP URI. The problem is that in order to use
those parsing functions, it's required to use them from a thread that
has registered with PJLib.

On startup, when parsing AOR configuration, the permanent URI handler
may not be run from a PJLib-registered thread. Specifically, this could
happen when Asterisk was started in daemon mode rather than
console-mode. If PJProject were compiled with assertions enabled, then
this would cause Asterisk to crash on startup.

The solution presented here is to do our own parsing of the contact URI
in order to ensure that the hostname in the URI is not too long. The
parsing does not attempt to perform a full SIP URI parse/validation,
since the hostname in the URI is what is important.

ASTERISK-25928 #close
Reported by Joshua Colp

Change-Id: Ic3d6c20ff3502507c17244a8b7e2ca761dc7fb60
res/res_pjsip/location.c