Changeset 152805 in webkit


Ignore:
Timestamp:
Jul 17, 2013, 3:05:45 PM (12 years ago)
Author:
ap@apple.com
Message:

[Mac] Crashes in CFURLGetBytes under WebProcess::updateActivePages()
https://bugs.webkit.org/show_bug.cgi?id=118814
<rdar://problem/14173389>

Reviewed by Brady Eidson.

Speculative fix. It's unclear how we end up with an invalid URL when committing
a load.

  • WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::updateActivePages): Added a null check.
Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r152795 r152805  
     12013-07-17  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] Crashes in CFURLGetBytes under WebProcess::updateActivePages()
     4        https://bugs.webkit.org/show_bug.cgi?id=118814
     5        <rdar://problem/14173389>
     6
     7        Reviewed by Brady Eidson.
     8
     9        Speculative fix. It's unclear how we end up with an invalid URL when committing
     10        a load.
     11
     12        * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::updateActivePages):
     13        Added a null check.
     14
    1152013-07-17  Commit Queue  <commit-queue@webkit.org>
    216
  • trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm

    r149832 r152805  
    239239        else
    240240            mainFrameOriginString = KURL(KURL(), mainFrame->url()).protocol() + ':'; // toRawString() is not supposed to work with unique origins, and would just return "://".
    241         CFArrayAppendValue(activePageURLs.get(), userVisibleString([NSURL URLWithString:mainFrameOriginString]));
     241
     242        NSURL *originAsNSURL = [NSURL URLWithString:mainFrameOriginString];
     243        // +[NSURL URLWithString:] returns nil when its argument is malformed. It's unclear how we can possibly have a malformed URL here,
     244        // but it happens in practice according to <rdar://problem/14173389>. Leaving an assertion in to catch a reproducible case.
     245        ASSERT(originAsNSURL);
     246        NSString *userVisibleOriginString = originAsNSURL ? userVisibleString(originAsNSURL) : @"(null)";
     247
     248        CFArrayAppendValue(activePageURLs.get(), userVisibleOriginString);
    242249    }
    243250    WKSetApplicationInformationItem(kLSActivePageUserVisibleOriginsKey, activePageURLs.get());
Note: See TracChangeset for help on using the changeset viewer.