[asterisk-dev] [Code Review] SIP URI comparison test (plus some bug fixes)
Olle E. Johansson
oej at edvina.net
Wed Jul 21 03:00:29 CDT 2010
20 jul 2010 kl. 15.15 skrev Simon Perreault:
> /trunk/channels/sip/reqresp_parser.c
> <https://reviewboard.asterisk.org/r/792/#comment5354>
>
> There's a subtle but important bug here: glibc's strcasecmp() is locale-dependent. SIP URI domains are limited to the ASCII character set. So we want ASCII-based case-insensitive comparison, not something that depends on the current locale.
>
> This could be solved by using strcasecmp_l() and passing the "C" locale (I think). Or just roll your own ASCII-based strcasecmp().
That is a huge issue and possibly affects many different parts of asterisk.
While writing the bug report I forgot to mention that the string comparision of IP also affects IPv4.
192.02.68.01 == 192.02.68.1
192.2.068.1 != 192.2.68.1
The zero prefix indicates that the group is written in octal notation...
/O
More information about the asterisk-dev
mailing list