Speculative fix for null pointer dereference.
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Apr 2016 21:25:15 +0000 (21:25 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Apr 2016 21:25:15 +0000 (21:25 +0000)
rdar://problem/25964854

Reviewed by Michael Saboff.

* platform/mac/Language.mm:
(WebCore::isValidICUCountryCode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200151 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/Language.mm

index 0432fa2..b02d46b 100644 (file)
@@ -1,3 +1,13 @@
+2016-04-27  Filip Pizlo  <fpizlo@apple.com>
+
+        Speculative fix for null pointer dereference.
+        rdar://problem/25964854
+
+        Reviewed by Michael Saboff.
+
+        * platform/mac/Language.mm:
+        (WebCore::isValidICUCountryCode):
+
 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Clean up Font::removeFromSystemFallbackCache()
index f751f21..3034370 100644 (file)
@@ -113,6 +113,8 @@ static String httpStyleLanguageCode(NSString *language, NSString *country)
 
 static bool isValidICUCountryCode(NSString* countryCode)
 {
+    if (!countryCode)
+        return false;
     const char* const* countries = uloc_getISOCountries();
     const char* countryUTF8 = [countryCode UTF8String];
     for (unsigned i = 0; countries[i]; ++i) {