Changeset 174827 in webkit


Ignore:
Timestamp:
Oct 17, 2014 11:49:02 AM (10 years ago)
Author:
ap@apple.com
Message:

[iOS] Crash when load is canceled while waiting for the user to type HTTP authentication credentials
https://bugs.webkit.org/show_bug.cgi?id=137826
rdar://problem/17329599

Reviewed by Brady Eidson.

No new tests, as we don't have a way to simulate details of user interaction with
an auth dialog.

  • platform/network/cf/ResourceHandleCFNet.cpp:

(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::receivedRequestToPerformDefaultHandling):
(WebCore::ResourceHandle::receivedChallengeRejection):
Added null checks before passing m_connection for CFNetwork functions, making this
match what Mac code does when sending a message to a nil receiver.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r174825 r174827  
     12014-10-17  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [iOS] Crash when load is canceled while waiting for the user to type HTTP authentication credentials
     4        https://bugs.webkit.org/show_bug.cgi?id=137826
     5        rdar://problem/17329599
     6
     7        Reviewed by Brady Eidson.
     8
     9        No new tests, as we don't have a way to simulate details of user interaction with
     10        an auth dialog.
     11
     12        * platform/network/cf/ResourceHandleCFNet.cpp:
     13        (WebCore::ResourceHandle::receivedCredential):
     14        (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
     15        (WebCore::ResourceHandle::receivedRequestToPerformDefaultHandling):
     16        (WebCore::ResourceHandle::receivedChallengeRejection):
     17        Added null checks before passing m_connection for CFNetwork functions, making this
     18        match what Mac code does when sending a message to a nil receiver.
     19
    1202014-10-17  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp

    r173501 r174827  
    432432        CredentialStorage::set(webCredential, challenge.protectionSpace(), urlToStore);
    433433
     434        if (d->m_connection) {
    434435#if PLATFORM(COCOA)
    435         CFURLConnectionUseCredential(d->m_connection.get(), webCredential.cfCredential(), challenge.cfURLAuthChallengeRef());
     436            CFURLConnectionUseCredential(d->m_connection.get(), webCredential.cfCredential(), challenge.cfURLAuthChallengeRef());
    436437#else
    437         RetainPtr<CFURLCredentialRef> cfCredential = adoptCF(createCF(webCredential));
    438         CFURLConnectionUseCredential(d->m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
    439 #endif
    440     } else {
     438            RetainPtr<CFURLCredentialRef> cfCredential = adoptCF(createCF(webCredential));
     439            CFURLConnectionUseCredential(d->m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
     440#endif
     441        }
     442    } else if (d->m_connection) {
    441443#if PLATFORM(COCOA)
    442444        CFURLConnectionUseCredential(d->m_connection.get(), credential.cfCredential(), challenge.cfURLAuthChallengeRef());
     
    458460        return;
    459461
    460     CFURLConnectionUseCredential(d->m_connection.get(), 0, challenge.cfURLAuthChallengeRef());
     462    if (d->m_connection)
     463        CFURLConnectionUseCredential(d->m_connection.get(), 0, challenge.cfURLAuthChallengeRef());
    461464
    462465    clearAuthentication();
     
    481484        return;
    482485
    483     CFURLConnectionPerformDefaultHandlingForChallenge(d->m_connection.get(), challenge.cfURLAuthChallengeRef());
     486    if (d->m_connection)
     487        CFURLConnectionPerformDefaultHandlingForChallenge(d->m_connection.get(), challenge.cfURLAuthChallengeRef());
    484488
    485489    clearAuthentication();
     
    494498        return;
    495499
    496     CFURLConnectionRejectChallenge(d->m_connection.get(), challenge.cfURLAuthChallengeRef());
     500    if (d->m_connection)
     501        CFURLConnectionRejectChallenge(d->m_connection.get(), challenge.cfURLAuthChallengeRef());
    497502
    498503    clearAuthentication();
Note: See TracChangeset for help on using the changeset viewer.