⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 116864 in webkit


Ignore:
Timestamp:
May 12, 2012, 9:22:42 PM (14 years ago)
Author:
inferno@chromium.org
Message:

Crash in HTMLSelectElement::setOption
https://bugs.webkit.org/show_bug.cgi?id=85420

Source/WebCore:

Reviewed by Eric Seidel

RefPtr before option in HTMLSelectElement::setOption since it
can get destroyed due to mutation events.

Test: fast/dom/HTMLSelectElement/option-add-crash.html

  • html/HTMLSelectElement.cpp:

(WebCore::HTMLSelectElement::setOption):

LayoutTests:

Reviewed by Eric Seidel.

  • fast/dom/HTMLSelectElement/option-add-crash-expected.txt: Added.
  • fast/dom/HTMLSelectElement/option-add-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r116860 r116864  
     12012-05-12  Abhishek Arya  <inferno@chromium.org>
     2
     3        Crash in HTMLSelectElement::setOption
     4        https://bugs.webkit.org/show_bug.cgi?id=85420
     5
     6        Reviewed by Eric Seidel.
     7
     8        * fast/dom/HTMLSelectElement/option-add-crash-expected.txt: Added.
     9        * fast/dom/HTMLSelectElement/option-add-crash.html: Added.
     10
    1112012-05-12  Philip Rogers  <pdr@google.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r116863 r116864  
     12012-05-12  Abhishek Arya  <inferno@chromium.org>
     2
     3        Crash in HTMLSelectElement::setOption
     4        https://bugs.webkit.org/show_bug.cgi?id=85420
     5
     6        Reviewed by Eric Seidel
     7       
     8        RefPtr before option in HTMLSelectElement::setOption since it
     9        can get destroyed due to mutation events.
     10
     11        Test: fast/dom/HTMLSelectElement/option-add-crash.html
     12
     13        * html/HTMLSelectElement.cpp:
     14        (WebCore::HTMLSelectElement::setOption):
     15
    1162012-05-12  Robin Dunn  <robin@alldunn.com>
    217
  • trunk/Source/WebCore/html/HTMLSelectElement.cpp

    r116756 r116864  
    414414        index = maxSelectItems - 1;
    415415    int diff = index - length();
    416     HTMLElement* before = 0;
     416    RefPtr<HTMLElement> before = 0;
    417417    // Out of array bounds? First insert empty dummies.
    418418    if (diff > 0) {
     
    425425    // Finally add the new element.
    426426    if (!ec) {
    427         add(option, before, ec);
     427        add(option, before.get(), ec);
    428428        if (diff >= 0 && option->selected())
    429429            optionSelectionStateChanged(option, true);
Note: See TracChangeset for help on using the changeset viewer.