Changeset 88627 in webkit


Ignore:
Timestamp:
Jun 12, 2011 9:55:42 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-12 Hironori Bono <hbono@chromium.org>

Reviewed by Hajime Morita.

Add null checks to HTMLTextAreaElement::removeSpellcheckRange().
https://bugs.webkit.org/show_bug.cgi?id=62526

This change adds null checks to the following function to prevent crashes
when calling removeSpellcheckRange() with null:
HTMLTextAreaElement::removeSpellcheckRange(),
HTMLInputElement::removeSpellcheckRange(), and
HTMLDivElement::removeSpellcheckRange().

  • editing/spelling/spellcheck-api-crash-expected.txt: Added.
  • editing/spelling/spellcheck-api-crash.html: Added.

2011-06-12 Hironori Bono <hbono@chromium.org>

Reviewed by Hajime Morita.

Add null checks to HTMLTextAreaElement::removeSpellcheckRange().
https://bugs.webkit.org/show_bug.cgi?id=62526

This change adds null checks to the following function to prevent crashes
when calling removeSpellcheckRange() with null:
HTMLTextAreaElement::removeSpellcheckRange(),
HTMLInputElement::removeSpellcheckRange(), and
HTMLDivElement::removeSpellcheckRange().

Test: editing/spelling/spellcheck-api-crash.html

  • html/HTMLDivElement.cpp: (WebCore::HTMLDivElement::removeSpellcheckRange):
  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::removeSpellcheckRange):
  • html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::removeSpellcheckRange):
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88626 r88627  
     12011-06-12  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Hajime Morita.
     4
     5        Add null checks to HTMLTextAreaElement::removeSpellcheckRange().
     6        https://bugs.webkit.org/show_bug.cgi?id=62526
     7
     8        This change adds null checks to the following function to prevent crashes
     9        when calling removeSpellcheckRange() with null:
     10        HTMLTextAreaElement::removeSpellcheckRange(),
     11        HTMLInputElement::removeSpellcheckRange(), and
     12        HTMLDivElement::removeSpellcheckRange().
     13
     14        * editing/spelling/spellcheck-api-crash-expected.txt: Added.
     15        * editing/spelling/spellcheck-api-crash.html: Added.
     16
    1172011-06-12  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r88623 r88627  
     12011-06-12  Hironori Bono  <hbono@chromium.org>
     2
     3        Reviewed by Hajime Morita.
     4
     5        Add null checks to HTMLTextAreaElement::removeSpellcheckRange().
     6        https://bugs.webkit.org/show_bug.cgi?id=62526
     7
     8        This change adds null checks to the following function to prevent crashes
     9        when calling removeSpellcheckRange() with null:
     10        HTMLTextAreaElement::removeSpellcheckRange(),
     11        HTMLInputElement::removeSpellcheckRange(), and
     12        HTMLDivElement::removeSpellcheckRange().
     13
     14        Test: editing/spelling/spellcheck-api-crash.html
     15
     16        * html/HTMLDivElement.cpp:
     17        (WebCore::HTMLDivElement::removeSpellcheckRange):
     18        * html/HTMLInputElement.cpp:
     19        (WebCore::HTMLInputElement::removeSpellcheckRange):
     20        * html/HTMLTextAreaElement.cpp:
     21        (WebCore::HTMLTextAreaElement::removeSpellcheckRange):
     22
    1232011-06-12  Adam Barth  <abarth@webkit.org>
    224
  • trunk/Source/WebCore/html/HTMLDivElement.cpp

    r88332 r88627  
    9696void HTMLDivElement::removeSpellcheckRange(RefPtr<SpellcheckRange> range)
    9797{
     98    if (!range)
     99        return;
    98100    document()->markers()->removeUserSpellingMarker(this, range->start(), range->length());
    99101}
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r88332 r88627  
    18621862void HTMLInputElement::removeSpellcheckRange(RefPtr<SpellcheckRange> range)
    18631863{
     1864    if (!range)
     1865        return;
    18641866    document()->markers()->removeUserSpellingMarker(this, range->start(), range->length());
    18651867}
  • trunk/Source/WebCore/html/HTMLTextAreaElement.cpp

    r88332 r88627  
    463463void HTMLTextAreaElement::removeSpellcheckRange(RefPtr<SpellcheckRange> range)
    464464{
     465    if (!range)
     466        return;
    465467    document()->markers()->removeUserSpellingMarker(this, range->start(), range->length());
    466468}
Note: See TracChangeset for help on using the changeset viewer.