Bug 65584 - Crash in ResourceResponse::platformCompare() with USE(CFNETWORK)
Summary: Crash in ResourceResponse::platformCompare() with USE(CFNETWORK)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pratik Solanki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-08-02 17:26 PDT by Pratik Solanki
Modified: 2011-08-02 22:08 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.56 KB, patch)
2011-08-02 17:29 PDT, Pratik Solanki
no flags Details | Formatted Diff | Diff
Patch (1.51 KB, patch)
2011-08-02 18:02 PDT, Pratik Solanki
ddkilzer: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Solanki 2011-08-02 17:26:04 PDT
Code does

    return CFEqual(a.cfURLResponse(), b.cfURLResponse());

And it crashes the cfURLResponses are 0 and CFEqual doesn't like that. This is fine on the Foundation side since we do

    return a.nsURLResponse() == b.nsURLResponse();
Comment 1 Pratik Solanki 2011-08-02 17:29:10 PDT
Created attachment 102718 [details]
Patch
Comment 2 Pratik Solanki 2011-08-02 17:30:04 PDT
<rdar://problem/9878360>
Comment 3 Darin Adler 2011-08-02 17:49:05 PDT
Comment on attachment 102718 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=102718&action=review

> Source/WebCore/platform/network/cf/ResourceResponseCFNet.cpp:144
> +#if PLATFORM(MAC)
> +    // CFEqual crashes if you pass it 0 and on Mac we can end up with cfURLResponse() being 0.
> +    if (!a.cfURLResponse() || !b.cfURLResponse())
> +        return a.cfURLResponse() == b.cfURLResponse();
> +#endif

This should be unconditional, not inside #if PLATFORM(MAC)
Comment 4 Pratik Solanki 2011-08-02 18:02:05 PDT
Created attachment 102724 [details]
Patch
Comment 5 Pratik Solanki 2011-08-02 18:02:21 PDT
Updated patch to make it unconditional.
Comment 6 David Kilzer (:ddkilzer) 2011-08-02 19:31:22 PDT
Comment on attachment 102724 [details]
Patch

r=me
Comment 7 Pratik Solanki 2011-08-02 22:08:28 PDT
Committed r92261: <http://trac.webkit.org/changeset/92261>