Changeset 80586 in webkit


Ignore:
Timestamp:
Mar 8, 2011 1:42:32 PM (13 years ago)
Author:
jberlin@webkit.org
Message:

Crash in CFNetwork visiting google.com
https://bugs.webkit.org/show_bug.cgi?id=55958

Reviewed by Anders Carlsson.

Source/WebKit2:

  • Shared/API/c/cf/WKURLResponseCF.cpp:

(WKURLResponseCopyCFURLResponse):
If the response to copy is null, return 0;

Tools:

Add a test for not trying to copy a null CFURLResponse.

  • TestWebKitAPI/Tests/WebKit2/win/DoNotCopyANullCFURLResponse.cpp: Added.

(TestWebKitAPI::TEST):

  • TestWebKitAPI/win/TestWebKitAPI.vcproj:
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r80585 r80586  
     12011-03-08  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Crash in CFNetwork visiting google.com
     6        https://bugs.webkit.org/show_bug.cgi?id=55958
     7
     8        * Shared/API/c/cf/WKURLResponseCF.cpp:
     9        (WKURLResponseCopyCFURLResponse):
     10        If the response to copy is null, return 0;
     11
    1122011-03-08  John Sullivan  <sullivan@apple.com>
    213
  • trunk/Source/WebKit2/Shared/API/c/cf/WKURLResponseCF.cpp

    r76916 r80586  
    3434WKURLResponseRef WKURLResponseCreateWithCFURLResponse(CFURLResponseRef urlResponse)
    3535{
     36    if (!urlResponse)
     37        return 0;
     38
    3639    CFURLResponseRef copiedURLResponse = CFURLResponseCreateCopy(kCFAllocatorDefault, urlResponse);
    3740    RefPtr<WebURLResponse> response = WebURLResponse::create(copiedURLResponse);
     
    4144CFURLResponseRef WKURLResponseCopyCFURLResponse(CFAllocatorRef alloc, WKURLResponseRef urlResponse)
    4245{
     46    if (!urlResponse)
     47        return 0;
     48
     49    PlatformResponse platformURLResponse = toImpl(urlResponse)->platformResponse();
     50    if (!platformURLResponse)
     51        return 0;
     52
    4353    return CFURLResponseCreateCopy(alloc, toImpl(urlResponse)->platformResponse());
    4454}
  • trunk/Tools/ChangeLog

    r80558 r80586  
     12011-03-08  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Crash in CFNetwork visiting google.com
     6        https://bugs.webkit.org/show_bug.cgi?id=55958
     7
     8        Add a test for not trying to copy a null CFURLResponse.
     9
     10        * TestWebKitAPI/Tests/WebKit2/win/DoNotCopyANullCFURLResponse.cpp: Added.
     11        (TestWebKitAPI::TEST):
     12        * TestWebKitAPI/win/TestWebKitAPI.vcproj:
     13
    1142011-03-08  Hayato Ito  <hayato@chromium.org>
    215
  • trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj

    r80001 r80586  
    449449                                </File>
    450450                                <File
     451                                        RelativePath="..\Tests\WebKit2\HitTestResultNodeHandle.cpp"
     452                                        >
     453                                </File>
     454                                <File
    451455                                        RelativePath="..\Tests\WebKit2\icon.png"
    452                                         >
    453                                 </File>
    454                                 <File
    455                                         RelativePath="..\Tests\WebKit2\HitTestResultNodeHandle.cpp"
    456456                                        >
    457457                                </File>
     
    517517                                        <File
    518518                                                RelativePath="..\Tests\WebKit2\win\AltKeyGeneratesWMSysCommand.cpp"
     519                                                >
     520                                        </File>
     521                                        <File
     522                                                RelativePath="..\Tests\WebKit2\win\DoNotCopyANullCFURLResponse.cpp"
    519523                                                >
    520524                                        </File>
Note: See TracChangeset for help on using the changeset viewer.