[asterisk-dev] [Code Review] SIP: decode uri after parsing

Olle E. Johansson oej at edvina.net
Mon Dec 21 09:39:37 CST 2009


21 dec 2009 kl. 16.35 skrev David Vossel:

> n chan_sip.c ast_uri_decode is called on the entire URI instead of it's individual parts after it is parsed.  This is not good as ast_uri_decode can introduce special characters back into the URI which can mess up parsing.  This patch resolves this by not decoding a URI until parsing is completely done.  There are many instances where we check to see if pedantic checking is enabled before we decode a URI.  In these cases a new macro, SIP_PEDANTIC_DECODE, is used on the individual parsed segments of the URI rather than constantly putting if (pedantic) { decode() } checks everywhere in the code.  In the areas where ast_uri_decode is not dependent upon pedantic checking this macro is not used, but decoding is still moved to each individual part of the URI.  The only behavior that should change from this patch is the time at which decoding occurs.

My suggestion is to decouple PEDANTIC from URI parsing. It seems only foolish to me to keep that. Let pedantic only be related to tag handling in the future.

/O


More information about the asterisk-dev mailing list