[Asterisk-code-review] PJSIP: Remove PJSIP parsing functions from uri length valida... (asterisk[13])

Joshua Colp asteriskteam at digium.com
Tue Apr 19 09:44:20 CDT 2016


Hello Anonymous Coward #1000019, George Joseph,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/2637

to look at the new patch set (#3).

Change subject: PJSIP: Remove PJSIP parsing functions from uri length validation.
......................................................................

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
---
M res/res_pjsip/location.c
1 file changed, 39 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/37/2637/3
-- 
To view, visit https://gerrit.asterisk.org/2637
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic3d6c20ff3502507c17244a8b7e2ca761dc7fb60
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list