]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a possible crash in sip/reqresp_parser.c that is caused by a possible null
authorBrett Bryant <bbryant@digium.com>
Wed, 23 Mar 2011 21:45:46 +0000 (21:45 +0000)
committerBrett Bryant <bbryant@digium.com>
Wed, 23 Mar 2011 21:45:46 +0000 (21:45 +0000)
value.

(closes issue #18821)
Reported by: cmaj
Patches:
      patch-reqresp_parser_sip_uri_domain_cmp_c_locale-crash-1.8.3-rc2.diff.tx
      uploaded by cmaj (license 830)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@311612 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/sip/reqresp_parser.c

index 5fb384c423c4cfc7fc6695f83ad2c0715b52a64c..0ad6468d87a0f21dd2a0f0c0fdc33b8ad999543a 100644 (file)
@@ -2009,7 +2009,11 @@ static int sip_uri_domain_cmp(const char *host1, const char *host2)
         */
        if (!addr1_parsed) {
 #ifdef HAVE_XLOCALE_H
-               return strcasecmp_l(host1, host2, c_locale);
+               if(!c_locale) {
+                       return strcasecmp(host1, host2);
+               } else {
+                       return strcasecmp_l(host1, host2, c_locale);
+               }
 #else
                return strcasecmp(host1, host2);
 #endif