Rubberstamped by Kevin Ollivier.
authorbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Aug 2009 21:03:41 +0000 (21:03 +0000)
committerbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Aug 2009 21:03:41 +0000 (21:03 +0000)
Check for null bundle before attempting to use it.

* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::certificatePath): Add null check on return of
  CFBundleGetBundleWithIdentifier.

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

WebCore/ChangeLog
WebCore/platform/network/curl/ResourceHandleManager.cpp

index a9f9fb3..f5f23d6 100644 (file)
@@ -1,3 +1,13 @@
+2009-08-20  Brent Fulgham  <bfulgham@webkit.org>
+
+        Rubberstamped by Kevin Ollivier.
+
+        Check for null bundle before attempting to use it.
+
+        * platform/network/curl/ResourceHandleManager.cpp:
+        (WebCore::certificatePath): Add null check on return of
+          CFBundleGetBundleWithIdentifier.
+
 2009-08-20  David Hyatt  <hyatt@apple.com>
 
         Reviewed by Dan Bernstein.
index baca717..d786599 100644 (file)
@@ -60,11 +60,13 @@ static CString certificatePath()
 {
 #if PLATFORM(CF)
     CFBundleRef webKitBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit"));
-    RetainPtr<CFURLRef> certURLRef(AdoptCF, CFBundleCopyResourceURL(webKitBundle, CFSTR("cacert"), CFSTR("pem"), CFSTR("certificates")));
-    if (certURLRef) {
-        char path[MAX_PATH];
-        CFURLGetFileSystemRepresentation(certURLRef.get(), false, reinterpret_cast<UInt8*>(path), MAX_PATH);
-        return path;
+    if (webKitBundle) {
+        RetainPtr<CFURLRef> certURLRef(AdoptCF, CFBundleCopyResourceURL(webKitBundle, CFSTR("cacert"), CFSTR("pem"), CFSTR("certificates")));
+        if (certURLRef) {
+            char path[MAX_PATH];
+            CFURLGetFileSystemRepresentation(certURLRef.get(), false, reinterpret_cast<UInt8*>(path), MAX_PATH);
+            return path;
+        }
     }
 #endif
     char* envPath = getenv("CURL_CA_BUNDLE_PATH");