Changeset 169472 in webkit


Ignore:
Timestamp:
May 29, 2014 4:04:30 PM (10 years ago)
Author:
ap@apple.com
Message:

Loading <object> from WebArchive crashes
https://bugs.webkit.org/show_bug.cgi?id=133386
<rdar://problem/13345509>

Reviewed by Brady Eidson.

Source/WebCore:
Test: webarchive/loading/object.html

This (a) fixes the crash, and (b) avoids the crash.

  • loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy):

Some types of substitute data - such as WebArchive - don't contain HTTP result codes,
so let's not drop to <object> fallback content when status is 0.
And if the load somehow failed anyway, don't crash by trying to deliver substitute data
to a finished loader.

LayoutTests:

  • webarchive/loading/object-expected.txt: Added.
  • webarchive/loading/object.html: Added.
  • webarchive/loading/resources/object.webarchive: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r169459 r169472  
     12014-05-29  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Loading <object> from WebArchive crashes
     4        https://bugs.webkit.org/show_bug.cgi?id=133386
     5        <rdar://problem/13345509>
     6
     7        Reviewed by Brady Eidson.
     8
     9        * webarchive/loading/object-expected.txt: Added.
     10        * webarchive/loading/object.html: Added.
     11        * webarchive/loading/resources/object.webarchive: Added.
     12
    1132014-05-29  Mark Lam  <mark.lam@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r169467 r169472  
     12014-05-29  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Loading <object> from WebArchive crashes
     4        https://bugs.webkit.org/show_bug.cgi?id=133386
     5        <rdar://problem/13345509>
     6
     7        Reviewed by Brady Eidson.
     8
     9        Test: webarchive/loading/object.html
     10
     11        This (a) fixes the crash, and (b) avoids the crash.
     12
     13        * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy):
     14        Some types of substitute data - such as WebArchive - don't contain HTTP result codes,
     15        so let's not drop to <object> fallback content when status is 0.
     16        And if the load somehow failed anyway, don't crash by trying to deliver substitute data
     17        to a finished loader.
     18
    1192014-05-29  Alex Christensen  <achristensen@webkit.org>
    220
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r165676 r169472  
    734734
    735735    if (m_response.isHTTP()) {
    736         int status = m_response.httpStatusCode();
    737         if (status < 200 || status >= 300) {
     736        int status = m_response.httpStatusCode(); // Status may be zero when loading substitute data, in particular from a WebArchive.
     737        if (status && (status < 200 || status >= 300)) {
    738738            bool hostedByObject = frameLoader()->isHostedByObjectElement();
    739739
     
    747747    }
    748748
    749     if (!isStopping() && m_substituteData.isValid()) {
     749    if (!isStopping() && m_substituteData.isValid() && isLoadingMainResource()) {
    750750        if (m_substituteData.content()->size())
    751751            dataReceived(0, m_substituteData.content()->data(), m_substituteData.content()->size());
Note: See TracChangeset for help on using the changeset viewer.