[asterisk-dev] [Code Review] SIP URI comparison test (plus some bug fixes)

Kevin P. Fleming kpfleming at digium.com
Tue Jul 20 16:07:11 CDT 2010


On 07/20/2010 06:40 PM, Simon Perreault wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/792/#review2434
> -----------------------------------------------------------
> 
> 
> 
> /trunk/channels/sip/reqresp_parser.c
> <https://reviewboard.asterisk.org/r/792/#comment5367>
> 
>     There is a race condition between the moment setlocale() is called and the moment strcasecmp() is called. The LC_CTYPE environment variable could have changed in the meantime.
>     
>     Also, it is very possible that newlocale() + freelocale() would be faster than setlocale(), since the latter involves at least one system call for reading an environment variable.

Environment variable reading does not involve system calls; a process'
environment is a block of memory it has a pointer to and owns, and it
can read/write it at will.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list