Changeset 32531 in webkit


Ignore:
Timestamp:
Apr 24, 2008 7:04:15 PM (16 years ago)
Author:
justin.garcia@apple.com
Message:

2008-04-24 Justin Garcia <justin.garcia@apple.com>

Reviewed by John Sullivan.


It is possible, despite our safeguards, for createMarkup to iterate past the end of the Range
that is passed to it. Added a null check to prevent crashes in this situation (we won't crash but
we will create too much markup), and added an ASSERT to hopefully catch the scenario in a debugger
and help us understand what's going on.

  • editing/markup.cpp: (WebCore::createMarkup):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r32530 r32531  
     12008-04-24  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by John Sullivan.
     4       
     5        It is possible, despite our safeguards, for createMarkup to iterate past the end of the Range
     6        that is passed to it.  Added a null check to prevent crashes in this situation (we won't crash but
     7        we will create too much markup), and added an ASSERT to hopefully catch the scenario in a debugger
     8        and help us understand what's going on.
     9
     10        * editing/markup.cpp:
     11        (WebCore::createMarkup):
     12
    1132008-04-24  Mark Rowe  <mrowe@apple.com>
    214
  • trunk/WebCore/editing/markup.cpp

    r31932 r32531  
    710710    Node* next;
    711711    for (Node* n = startNode; n != pastEnd; n = next) {
     712   
     713        // According to <rdar://problem/5730668>, it is possible for n to blow past pastEnd and become null here.  This
     714        // shouldn't be possible.  This null check will prevent crashes (but create too much markup) and the ASSERT will
     715        // hopefully lead us to understanding the problem.
     716        ASSERT(n);
     717        if (!n)
     718            break;
     719   
    712720        next = n->traverseNextNode();
    713721        bool skipDescendants = false;
Note: See TracChangeset for help on using the changeset viewer.