Changeset 151875 in webkit


Ignore:
Timestamp:
Jun 21, 2013 7:36:13 PM (11 years ago)
Author:
ggaren@apple.com
Message:

Crashes due to NULL dereference beneath WebCore::StyleResolver::loadPendingSVGDocuments and related functions
https://bugs.webkit.org/show_bug.cgi?id=117903

Reviewed by Darin Adler.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::loadPendingSVGDocuments): Add a NULL check for
RenderStyle here...
(WebCore::StyleResolver::loadPendingResources): ...and here.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r151873 r151875  
     12013-06-21  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Crashes due to NULL dereference beneath WebCore::StyleResolver::loadPendingSVGDocuments and related functions
     4        https://bugs.webkit.org/show_bug.cgi?id=117903
     5
     6        Reviewed by Darin Adler.
     7
     8        * css/StyleResolver.cpp:
     9        (WebCore::StyleResolver::loadPendingSVGDocuments): Add a NULL check for
     10        RenderStyle here...
     11        (WebCore::StyleResolver::loadPendingResources): ...and here.
     12
    1132013-06-21  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r151783 r151875  
    35633563{
    35643564    State& state = m_state;
    3565     if (!state.style()->hasFilter() || state.pendingSVGDocuments().isEmpty())
     3565
     3566    // Crash reports indicate that we've seen calls to this function when our
     3567    // style is NULL. We don't know exactly why this happens. Our guess is
     3568    // reentering styleForElement().
     3569    ASSERT(state.style());
     3570    if (!state.style() || !state.style()->hasFilter() || state.pendingSVGDocuments().isEmpty())
    35663571        return;
    35673572
     
    41964201void StyleResolver::loadPendingResources()
    41974202{
     4203    // We've seen crashes in all three of the functions below. Some of them
     4204    // indicate that style() is NULL. This NULL check will cut down on total
     4205    // crashes, while the ASSERT will help us find the cause in debug builds.
     4206    ASSERT(style());
     4207    if (!style())
     4208        return;
     4209
    41984210    // Start loading images referenced by this style.
    41994211    loadPendingImages();
Note: See TracChangeset for help on using the changeset viewer.