Bug 65584

Summary: Crash in ResourceResponse::platformCompare() with USE(CFNETWORK)
Product: WebKit Reporter: Pratik Solanki <psolanki>
Component: PlatformAssignee: Pratik Solanki <psolanki>
Status: RESOLVED FIXED    
Severity: Normal CC: ddkilzer, jberlin, psolanki
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch ddkilzer: review+

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>